You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 zmwangx@48e9564 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.
The text was updated successfully, but these errors were encountered:
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 zmwangx@48e9564 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.The text was updated successfully, but these errors were encountered: