So I have my post logic:
var data = new FormData();
this.fields.forEach(field => data.append(field.question, field.answer));
console.log(data);
this.http
.fetch('login', {
method: 'POST',
body: data
})
.then(response => response.json())
.then(loginResult => {
});
The console.log
shows the object with the correct information in it!
So I'm happy with the data being populated.
The request payload is this:
------WebKitFormBoundaryM4BOxXFW0i3zM4SY
Content-Disposition: form-data; name="passcode"
mysecretpasscode
------WebKitFormBoundaryM4BOxXFW0i3zM4SY--
Which the owin backend doesn't understand:
var form = await c.Request.ReadFormAsync();
c
being the OwinContext
. The output of form
is one entry, with all that payload text in.
Clearly it is trying to send multipart/form-data
when I want application/x-www-form-urlencoded
What am I miss configuring here?
Edit - based on possible duplicate
I tried to use that solution but it didn't solve my problem.