Forum Discussion

debchat1955's avatar
debchat1955
Occasional Contributor
7 years ago

I could use SOAPUI (not PRO) successfully for REST, GET method. But POST poses issues

Not sure if SOAPui documentation gives clear help on POST, PATCH methods.

 

For parameters, what are the style, level values?

 

I can get "GET method" to work properly in SOAPui.

 

Surfing around, I have noticed that some other users also faced some issues.

 

Can you point me to relevant documentation?

 

Thank you.

  • The 'Post QueryString' option will send the message body as:

     

    ?name=TST

     

    But it looks like you need to be sending as JSON. Turn off Post QueryString, then choose media type application/json and enter into the body, which is the field below that, your JSON:

     

    {"name": "TST"}
  • JHunt's avatar
    JHunt
    Community Hero

    The 'Post QueryString' option will send the message body as:

     

    ?name=TST

     

    But it looks like you need to be sending as JSON. Turn off Post QueryString, then choose media type application/json and enter into the body, which is the field below that, your JSON:

     

    {"name": "TST"}
    • debchat1955's avatar
      debchat1955
      Occasional Contributor

      Hi

       

      [gecko2 ~]$ curl -i -X POST -H 'Content-Type: application/json' -d '{"name": "DC1"}' http://cal-app2-dev:8100/kws-rest/v4/surveys

      HTTP/1.1 200 OK

      ...

       

      It works fine and creates record in database as expected.

       

      But when I try something similar in SOAPui, then I get error as shown in the attachment.

       

      Can you please check and advise?

       

      Thank you

       

       

  • debchat1955's avatar
    debchat1955
    Occasional Contributor

    Thanks JHunt for prompt response. Indeed, things are working as expected when I use your suggested solution.