Reply
Highlighted
New Contributor
Posts: 4
Registered: ‎08-12-2017

How to create a REST request with x-www-form-urlencoded content-type in ReadyAPI 2.1.0?

Body of the request is in application/x-www-form-urlencoded format, this request do not work in any other format.

 

I tried to create this request by manually giving the value content-type as  application/x-www-form-urlencoded in Headers and body of the request in this format: grant_type=password&username=XXXX&password=XXXXX

 

But this is also not working, so please let me know how can I create this request in ReadyAPI?

Community Hero
Posts: 4,820
Registered: ‎05-17-2013

Re: How to create a REST request with x-www-form-urlencoded content-type in ReadyAPI 2.1.0?

Use Media Type value as "application/x-www-form-urlencoded"
New Contributor
Posts: 4
Registered: ‎08-12-2017

Re: How to create a REST request with x-www-form-urlencoded content-type in ReadyAPI 2.1.0?

Please read the query carefully.

 

As mentioned there I already tried that, but that is not working.

Community Hero
Posts: 4,820
Registered: ‎05-17-2013

Re: How to create a REST request with x-www-form-urlencoded content-type in ReadyAPI 2.1.0?

I think I read it carefully. It was mentioned Content-Type. It is suggested to use Media Type.
New Contributor
Posts: 4
Registered: ‎08-12-2017

Re: How to create a REST request with x-www-form-urlencoded content-type in ReadyAPI 2.1.0?

Media type is a predefined list in ReadyAPI that is not editable.

 

I tried passing Media type in Header but it takes value from list only. By default in request it takes value of Media Type as content type i.e. when we select any format of the request in Media type list, in request (Raw) it will be shown as content-type. Hence Media type and Content type is a something.

Community Hero
Posts: 4,820
Registered: ‎05-17-2013

Re: How to create a REST request with x-www-form-urlencoded content-type in ReadyAPI 2.1.0?

It gives you the list. However, you can still edit, I guess.
New Contributor
Posts: 4
Registered: ‎08-12-2017

Re: How to create a REST request with x-www-form-urlencoded content-type in ReadyAPI 2.1.0?

I tried, that is not working.

Can you suggest some alternate way to do that ??

 

Community Hero
Posts: 4,820
Registered: ‎05-17-2013

Re: How to create a REST request with x-www-form-urlencoded content-type in ReadyAPI 2.1.0?

What is the method you are trying to use?
Community Leader
Posts: 160
Registered: ‎12-06-2016

Re: How to create a REST request with x-www-form-urlencoded content-type in ReadyAPI 2.1.0?

https://support.smartbear.com/readyapi/docs/projects/ui/request/request/vertical/rest.html

The media type of the request body. You can select one of the values from the drop-down list or enter your own value.