Hi Ktorians!
With Ktor client I do the following request:
<http://client.post|client.post>(loginUrl) {
setBody(FormDataContent(Parameters.build {
append("username", username)
append("password", password)
append("submit", "Log in")
}))
}
This results in a successful login.
Now with Javascript I want to do the same:
fetch(loginUrl, {
method: 'POST',
headers:{
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
username,
password,
submit: 'Log in'
})
})
This does not result in a successful login.
Can anybody tell me how Ktor client handles this Form post different than JS does?