cancel
Showing results for 
Search instead for 
Did you mean: 

Rest - Parameter empty value

Highlighted
New Contributor

Rest - Parameter empty value

Hi,

 

I want to send a parameter with empty value in the rest request itself in soap-ui. I tried cloning my one of the existing resources and made the parameter required too.But still I'm not able to send the parameter with empty value.Can you please help me on this to solve my problem? 

 

My request would be something similar to this and I'm specifying the type parameter with an empty value.

GET http://localhost/service?type=

 

Thank you in advance !

3 REPLIES 3
Highlighted
Community Hero

Re: Rest - Parameter empty value

Hey @Madhavi_1,

Can you provide some screenshots of your REST request setup please?

Reason i ask to see what youve currently got setup is that ive submitted blank REST parameters loads of times before now when ive made a mistake and unintentionally submitted a blank rather than the intended value!

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
New Contributor

Re: Rest - Parameter empty value

Hi,

 

This is the way i want to send my request whereas the last parameter to be sent as empty.Hope this will help you to understand my question.If you need more inputs,let me know. 

 Thank you !!

 

https://<server>/<Service>?patient=123&_query=DocumentType&DocumentTypeIds=

 

madhavi_l_0-1600691620392.png

 

Highlighted
Community Hero

Re: Rest - Parameter empty value

Hey @madhavi_l 

 

oh! the last parameter? Right sorry - I didnt realise

 

Im using ReadyAPI! and it appears that if you dont include a value on the last query parm - the whole parm itself is removed - which is the same behaviour in SoapUI I'm assuming?

 

Yeah- that's no problem - just change the order of the parameters so any parameter you want to submit a blank/no value on isn't the last parameter - then it'll work fine.

 

The rules around query parms in REST is pretty clear - you can submit them in any order you wish

 

So - using your example URL

 

https://<server>/<Service>?patient=123&_query=DocumentType&DocumentTypeIds=

 

here above - 'patient' and 'query' can be submitted with blanks/no value, but DocumentTypeIds cant be blank

 

If you want to submit blank DocumentTypeIds - just alter the sequence of parms so the one you want blank IS NOT the last parm in the sequence, so it reads like the following:

 

https://<server>/<Service>?patient=123&DocumentTypeIds=&_query=DocumentType

 

Clear?

 

Cheers,

 

rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors