-
Notifications
You must be signed in to change notification settings - Fork 158
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
support requests containing form data #159
Comments
i am curious about this as well |
@jbailey4 I'm also running into a similar issue. Any traction on this? |
Parsing form data into language-specific objects is not handled identically across application servers. At a cursory investigation a while back there were so many small differences that it didn't seem reliable to include this in Pretender without spawning a list of Issues related to "parses X wrong" (where "wrong" means "not like the server application library I am communicating with in production"). Indeed, just for nodejs, there are several competing body parsers that all return slightly different outputs for url encoded form bodies: https://github.com/expressjs/body-parser#bodyparserurlencodedoptions, https://www.npmjs.com/package/body#readme, https://github.com/Raynos/body, https://www.npmjs.com/package/co-body#readme I'd be happy to recommend in the README a set of HTML encoded parsers that match the parsers people are using! |
@trek Agreed. I think adding some docs on this in the README and mentioning parsing request bodies should be handled according to your environment setup will be helpful. |
How should requests with form data be handled? Is there a way to parse form data with pretender?
Currently in the FakeRequest containing form data the request body looks like the following:
requestBody: "foo=bar&baz=someValue"
The text was updated successfully, but these errors were encountered: