asyrjasalo / RESTinstance

Robot Framework library for RESTful JSON APIs
https://pypi.org/project/RESTinstance
GNU Lesser General Public License v3.0
209 stars 83 forks source link

For content type - application/x-www-form-urlencoded, it always says "Missing grant_type parameter value" #24

Closed karthiksml closed 6 years ago

karthiksml commented 6 years ago

For content type - application/x-www-form-urlencoded, it always says "Missing grant_type parameter value"

Do we have any way to post "application/x-www-form-urlencoded" content types.

{"Content-Type": "application/x-www-form-urlencoded} grant_type=password&username=test%40test.com&password=test%40018&scope=openid&tenantDomain=test.com

Output: { "error_description": "Missing grant_type parameter value", "error": "invalid_request" }

Please suggest

asyrjasalo commented 6 years ago

Could you post the test case here where you are trying this?

karthiksml commented 6 years ago

we are trying to create access token with an API call in our application.

Scenario: Set Headers {"content-type": "application/x-www-form-urlencoded", "Authorization": "Bearer Y1hXTzNRWlMzQVRmWEpQa1BjS2pFTjg4MGk4YTpjVjVRQk5yVWUyN2M2QXBfQ2lyWllpbmRZeEl"} Post /token grant_type=password&username=test@test.com&password=test@123&scope=openid&tenantDomain=test.com Output response body

Result: { "error_description": "Missing grant_type parameter value", "error": "invalid_request" }

am i missing anything here. I couldn't give u the actual data due to organization norms.

pls help me out here

asyrjasalo commented 6 years ago

I haven't tested with this Content-Type. The focus of this library is about testing JSON APIs - I am happy to review and recommend if anyone forks the library for any other purpose.