Open jbr opened 3 years ago
That would be amazing, and I think an excellent use of Surf middleware!
In case anyone sees this and is unclear what stage this proposal is at: I am not currently working on this, and will update this issue if I start. I encourage others to do likewise
I'm working on this; I have a basic middleware working at https://github.com/rjframe/surf-vcr. I've only done minimal testing thus far but will be doing more in the next week or two.
This would entail an external crate that provides a surf middleware with two modes (or potentially two different middlewares)
When it's in recording mode, it transparently writes all requests and responses to disk in a configurable well-known location in a human-readable and editable format of some sort. When it's in playback mode, instead of making requests against external servers, it responds with the data from disk
references: