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
Rest Assured doesn't support web form posting "application/x-www-form-urlencoded" #841
Comments
Hi! Firstly, have you tried to use the enum member As for described issue, RA appends the default charset to Content-Type header if you don't specify one. So, your actual header looks like "application/x-www-form-urlencoded;charset=UTF-8; charset=UTF-8;", and hence can't be parsed. You can disable this with the following config |
Same problem over here:
with
|
This looks like a bug indeed. Need to investigate it. |
same here:
and test:
|
is there any workaround to post a |
Since the content-type is "x-www-form-urlencoded", Instead of using 'body' tag, use the 'formparam' tag in the request. Ex: Replace body("Example","ExValue") with formParam("formParamName", "value1"). Let to know whether if it works. |
@medineshkumar it works with |
What if I want to use a POJO class with gson serialization as request body? In such case I will have to pass it as "body" and it gives the same above error. |
I tried with the formParam and still getting the below error any ideas. import static io.restassured.RestAssured.*;
} Getting below Error:
|
Getting same request = given() Error - Cannot serialize because cannot determine how to serialize content-type multipart/form-data |
I ran into the same issue. Funny enough, it works when I remove the content-type header. So something like this:
|
WHEN I post a request for authentication, the error occurs to say that:
Here is my test method
The text was updated successfully, but these errors were encountered: