Closed DanielRamosAcosta closed 2 years ago
Afaik there may have been some confusion here…
x-www-form-urlencoded requests
you can just use the .send()
API. Ref: https://visionmedia.github.io/superagent/#post--put-requests.field()
you have used here is for multipart/form-data
requests. Ref: https://visionmedia.github.io/superagent/#multipart-requestsSee https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST#example for some examples highlighting the request differences.
Instead try…
const request = await superoak(app);
await request.post("/")
.send("hello=world&foo=bar");
or similar variations 😄
That's right!
I ended doing:
await request.post("/")
.type("form")
.send({ hello: "world", foo: "bar" })
Issue
Setup:
Details
When sending a form like:
Instead of receiving
{hello: "world", foo: "bar"}
I'm receiving the following:I'm going to open a PR with a failing test to validate this