Forum Discussion

von_bailey's avatar
von_bailey
Contributor
9 years ago

Missing JSON in Request

I have created a project in SoapUI which, once a test case has completed, it hooks into TestRails and updates test case results.  However, this process means that JSON must be sent with the request to pass the values of the test results.  My problem seems to be that the SoapUI doesn't include the JSON in the request.

 

See video at: http://screencast.com/t/pSessK4tSO

 

As the video shows, the JSON is formatted correctly and the Media Type is set correctly, yet the request does not include the body.  

 

5 Replies

  • rupert_anderson's avatar
    rupert_anderson
    Valued Contributor

    Hi,

     

    Sorry, this isn't mean't to be a daft question - but isn't it just that the JSON request body doesn't show in the Raw Request window?

     

    I can see that your request has a content length of 107 bytes and your request log has (1) request. I think this may just be the way JSON REST request show? Haven't double checked XML REST requests recently, but if I do a JSON REST POST then the request body doesn't show in the Raw Request Window, but it does actually post the JSON and the JSON content shows in the HTTP log tab.

     

    Sorry if I missed some thing.

     

    Cheers,

    Rupert

    • von_bailey's avatar
      von_bailey
      Contributor

      Not unless the Raw Request window works differently than it does in the licensed version of SoapUI, which does show the JSON in the Raw Request window.  Are you saying it's the norm in the non-licensed version not to display the JSON in the Raw Request window?  Regardless, the problem is that when it doesn't show up in the Raw Request window, I get an error referencing the JSON.  {"error": "Content-Type header missing (use Content-Type: application/json)"}

       

      Capture1.PNG

      Since the Content-Type header is not missing I have to assume the error is not referencing that directly.

       

      When the JSON does show up in the Raw Request Window(in the licensed version) the request does not create an error.

      I have to assume that the lack of the JSON in the request (which, aside from a failed request is the only difference from the licensed version) is the cause of the issue.



       

       

      • von_bailey's avatar
        von_bailey
        Contributor

        Just had a dialog with a co-worker and he noticed something that I hadn't.  The request is not showing the JSON because it is sending a "GET" instead of a "POST". 

        Capture2.PNG

         

        As you can see in the image, the method is defined as a POST, but the Raw Request is saying that it is sending a GET.  What would confuse the application in this manner?