Forum Discussion

anrobinson01's avatar
anrobinson01
Occasional Visitor
5 years ago

ReadyAPI GET with Body

I'm trying to use ReadyAPI to submit a GET with a Body.  It appears from what I read that it is not supported.  Is there some workaround for this and will ReadyAPI ever support it?

 

  • Hi,

     

    To add a request body to a GET request please add the below to the ReadyAPI install/bin/ReadyAPI.vmoptions file and restart ReadyAPI.  

     

    -Dallow.get.request.body=true

     

    There should be a request body text area for GET requests after doing this.

     

    Regards,

    Marcus James

    SmartBear Support

  • richie's avatar
    richie
    Community Hero
    Hey anrobinson01,

    Yep youre right.....the current ReadyAPI! functionality doesnt include the ability to submit a GET request with a body because this essentially breaks the "rules" that are defined for http requests.

    I cant remember the specific RFC numbers that describe http/http methods but theyre pretty clear.....an http request with a GET method does NOT include a payload (a body).

    You could submit a new feature request to get this included in some time in the future in ReadyAPI! but i doubt this would ever be included in a future release cos GETs arent supposed to have a payload.

    I am assuming your GET request Reads data as opposed to creating/updating data? (like an SQL's SELECT data retrieval).

    Strictly speaking you could raise a defect on the interface design spec (the requirement that defines the API youre talking about), so that the erroneous requirement is updated to comply with RFC standards which would then require the code to be fixed. Either changing the method to maybe a POST method which supports a request payload or change the API so the the parameters you are currently defining in the request payload is instead handled by REST parameters on your request (most likely query parameters).

    Ta

    Rich

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Awesome advice, thank you!

       

      anrobinson01 how did you solve this? Please mark the best answer as a solution!

      • MarcusJ's avatar
        MarcusJ
        Moderator

        Hi,

         

        To add a request body to a GET request please add the below to the ReadyAPI install/bin/ReadyAPI.vmoptions file and restart ReadyAPI.  

         

        -Dallow.get.request.body=true

         

        There should be a request body text area for GET requests after doing this.

         

        Regards,

        Marcus James

        SmartBear Support