cancel
Showing results for 
Search instead for 
Did you mean: 

REST Post Method changed to GET automatically when certain parameters are empty or null

SOLVED
Highlighted
Occasional Visitor

REST Post Method changed to GET automatically when certain parameters are empty or null

I am using SOAP UI NG Trial Version

 

When I Submit Request for POST method with empty or null parameters, then the request is submitted as GET method.

 

Example: https://localhost:8443/postdata

Params:

Firstname : empty / null

Lastname : empty / null\

address1 : empty / null\

address2 : empty / null\

city  : empty / null\

stateselect : empty / null\

zipcode : empty / null\

birthdatemonth : empty / null\

birthdateday : empty / null\

birthdateyear : empty / null\

gender : empty / null\

emailaddress : empty / null\

client_id : skldhflkafkla

state : test

 

PostChangedToGet.jpg

 

Is there anything I am doing wrong or is it bug in SOAP UI NG Pro, the same SOAP UI project works in SOAP UI Free version.

 

Please let me know your inputs

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Contributor

Re: REST Post Method changed to GET automatically when certain parameters are empty or null

Here's the reply from Support

 

Hello,

Under the Project tab configure the request as a POST instead of a GET. When you pass Sample requests into a testcase they still take the config from their parent in the projects tab.

Regards,
Temil

But I already have the request on POST Method on the Project tab, but it still does a GET Method on the Raw Request.

After looking further on my Project, the POST Method Request will have a redirect response.

By default the Request Properties will have Follow Redirects = true

 

I changed that property to false, and VOILA! it changes into Post.

Please see screenshot below

screenshot_01152016.jpg

 

I don't really have a clear answer on this but I guess on my project, if the POST Request will respond into a redirect, I just have to set the Follow Redirects to false to ensure that the request will do a Post.

 

I don't know if this really helps, but these solves my problem

 

View solution in original post

8 REPLIES 8
Highlighted
Community Hero

Re: REST Post Method changed to GET automatically when certain parameters are empty or null

If I understand it right, it might be of some kind fault.
You can easily verify this by doing:
1. save the project in soapui free version
2. remove it (by right click on project) from work space.
3. start readyapi
4. import the project saved in above
5. run the test, see if that is going fine.
If so, in correct method was selected earlier in readyapi while you noticed this issue.


Regards,
Rao.
Highlighted
New Contributor

Re: REST Post Method changed to GET automatically when certain parameters are empty or null

I want to bump this post because I have the same issue where I have a Post Method but it was being set to Get

I am using licensed Ready API. Is this a bug on ReadyApi?

 

the Post Method redirects the user to /home

But I don't know why it changes to Get

 

Please see screenshot

screenshot_01132016.jpg

 

 

Highlighted
Community Manager

Re: REST Post Method changed to GET automatically when certain parameters are empty or null

Hi Guys,

 

This sounds like an issue in Ready! API 1.5. @iano, are you using Ready! API 1.5.0 as well?

I recommend that you submit this behavior to our Ready! API Support Team so that they could investigate it. You can do this by filling in the following Contact Support form: https://support.smartbear.com/product-list/

 

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
New Contributor

Re: REST Post Method changed to GET automatically when certain parameters are empty or null

yup. I am using 1.5.0

Thanks @TanyaGorbunova, will file this

Highlighted
Community Manager

Re: REST Post Method changed to GET automatically when certain parameters are empty or null

Thanks, Iano. Please share the solution with us then.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
New Contributor

Re: REST Post Method changed to GET automatically when certain parameters are empty or null

Here's the reply from Support

 

Hello,

Under the Project tab configure the request as a POST instead of a GET. When you pass Sample requests into a testcase they still take the config from their parent in the projects tab.

Regards,
Temil

But I already have the request on POST Method on the Project tab, but it still does a GET Method on the Raw Request.

After looking further on my Project, the POST Method Request will have a redirect response.

By default the Request Properties will have Follow Redirects = true

 

I changed that property to false, and VOILA! it changes into Post.

Please see screenshot below

screenshot_01152016.jpg

 

I don't really have a clear answer on this but I guess on my project, if the POST Request will respond into a redirect, I just have to set the Follow Redirects to false to ensure that the request will do a Post.

 

I don't know if this really helps, but these solves my problem

 

View solution in original post

Highlighted
Contributor

Re: REST Post Method changed to GET automatically when certain parameters are empty or null

Hello,

 

I experience the same problem for one of my REST requests.

The issue happens when I run it with the maven plugin , the POST method type is automatically getting switched to GET

The issue do not happen when the test runs from SoapUI GUI tool end 

Any idea on this how to resolve it 

Couldn't figure out anything from my end 

 

Thankks

Highlighted
Occasional Visitor

Re: REST Post Method changed to GET automatically when certain parameters are empty or null

How is this the solution?

If you see closely. When Follow Redirects was 'true' your request console was showing GET for /home url.

When you turned Follow Redirects to 'false', request console shows your original url (/Login) as POST. Redirect has not happened here.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors