-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to return the response data as a string? #148
Comments
i'd also like to use an array instead of an object. The second parameter of reply should be any type |
@ctimmerm any update or fix on how to send an array as a data? |
nothing news? |
The axios default transformResponse parses strings to json objects. If you don't want this to happen, replace transformResponse in the config. |
try this |
This won't work if the At the moment, it appears a custom transformResponse on the request is called, but the data isn't passed to it. I'm going to investigate further. |
mock.onGet('/api').reply(200, '{"test": 5}')
response.data
is a JS object that looks like{test: 5}
instead of a string.Is there any way to force the response to be a string?
The text was updated successfully, but these errors were encountered: