Closed rafakwolf closed 7 years ago
This should work (from Post example):
RestClient.Resource('http://localhost:8080/java-rest-server/rest/person')
.Accept(RestUtils.MediaType_Json)
.ContentType('application/x-www-form-urlencoded')
.Post<TPerson>(vPerson);
Thanks!
@RobertoSchneiders
Did not work :(
What exactly is happening @rafakwolf?
The APIs with Bearer Token authentication, needs the application/x-www-form-urlencoded to request for tokens... so, the receiving response is ( _unsupported granttype ) with status code 400.
@rafakwolf I don't think this is a problem related to this library.
The error unsupported grant_type
suggest that you are not passing the correct grant_type
parameter to the request or you are not informing this parameter at all.
It should look like this:
grant_type=password&username=yourusername&password=yourpassword
http://stackoverflow.com/a/29261024
If this doesn't help, can you share your code with us? What API you are trying to consume?
Closed by inactivity.
How can i set ContentType = 'application/x-www-form-urlencoded' ?
Thanks