cancel
Showing results for 
Search instead for 
Did you mean: 

How to omit parameters in a REST request

SOLVED
Contributor

Re: How to omit parameters in a REST request

@nmrao 

Hi Rao,  I know I'm a pain in the ass,  but I'm someone who likes to learn and understand what I'm reading....in code  :-)

When I look at the Groovy Script there is a part that points to the SERVICE_HOST_PORT that I have declared on Project Level in 'Custom Properties' (  def serviceHost = context.expand('${#Project#SERVICE_HOST_PORT}')  )

 

Can I asume  that the script is indeed making contact with the SwaggerHub where our data is on and that the script is not only taking the properties on TestCase level in 'Custom Properties)?

Thanks,

AboveAndBeyond

Contributor

Re: How to omit parameters in a REST request

Replies on my questions   :-)

1) Yes, the groovy script is indeed making contact with the Enpoint, though I needed to have a lot of patience before the answer came.

2) If I want the result being written in readable json code I need to change the last line of the script:

log.info groovy.json.JsonOutput.prettyPrint(response.toString())

instead of

log.info groovy.json.JsonOutput.prettyPrint(response.text)

or so I've read.

Moderator

Re: How to omit parameters in a REST request

About omitting the parameters...
If a parameter with an empty value shouldn't be sent, you need to un-check the Required check-box for this parameter in the Advanced options section
 for this parameter.

 

ReadyAPI_2019-03-01_12-56-34.jpg


Anastasia
Customer Care Team


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

Contributor

Re: How to omit parameters in a REST request

NOTE: when you omit the parameter in ReadyAPI as Nastya said, this will be inherited by all testsuites and it's testcases and teststeps of that project. The parameter won't be send as long no value is present in the parameter value field.

omit parameters.png

New Here?
Join us and watch the welcome video:
Watch the new interview
Top Kudoed Authors