I'm trying to mock a third-party API that returns base64-encoded binary data as text/plain. Unfortunately, at the moment parseJson, application/plain and JSON.stringify are hard-coded so that seems impossible.
Would you consider adding support for arbitrary requests and responses? I have a patch at https://github.com/zmwangx/vite-plugin-mock/commit/48e9564bc931d4c32312f5a913aa206432a3cc1c adding a rawResponse option to MockMethod to achieve this. I can send a PR if you're okay with that approach, but as long as this use case is made possible, anything goes for me. Thanks.
I'm trying to mock a third-party API that returns base64-encoded binary data as
text/plain
. Unfortunately, at the momentparseJson
,application/plain
andJSON.stringify
are hard-coded so that seems impossible.https://github.com/anncwb/vite-plugin-mock/blob/798c61ddd81b9af782ca870139b4a2a6938d624a/src/createMockServer.ts#L77-L83
Would you consider adding support for arbitrary requests and responses? I have a patch at https://github.com/zmwangx/vite-plugin-mock/commit/48e9564bc931d4c32312f5a913aa206432a3cc1c adding a
rawResponse
option toMockMethod
to achieve this. I can send a PR if you're okay with that approach, but as long as this use case is made possible, anything goes for me. Thanks.