Check Out the Latest News About SmartBear Connect
JOIN OUR WEEKLY CHALLENGE
API_Bloom_banner

API Bloom is a weekly prize-winning challenge in the Ready! API Community. Each week, we assign a task that you need to accomplish to become a winner. See the rules here.

THIS WEEK TASK
Give the biggest number of Solutions on the Ready! API forums
Top 3 contributors will get $50, $35, and $15 gift cards!

WEEK 1-12 WINNERS
@nmrao, @msiadak, @Debz, @richie, @Emil91, @PramodYadav, @jkrier, @sanj, @mbheeke, @Radford, @kmaster, @kbw

Reply
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?

Highlighted
Community Hero
Posts: 4,598
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,598
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,598
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,598
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?
Frequent Contributor
Posts: 93
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.

Let's Meet in Boston
Join the user conference on Sep 12-13