Forum Discussion

ArunS's avatar
ArunS
Occasional Contributor
6 years ago
Solved

Passing payload to GET request

Hi All, There is one GET request which is accepting JSON as payload, tried to pass payload to GET request in SOAPUI but couldn't get text box to send payload. If anyone knows how to pass payload to G...
  • nmrao's avatar
    6 years ago
    Check with your team if it was a mistake or defect. If you are passing payload, then it should be a POST method.
  • richie's avatar
    richie
    6 years ago
    Yeah rao's right...http rules (check out w3.org or similar) define a GET as a data retrieval based on parameters included in the URI and query string and so shouldn't include a payload.

    I have worked on a project when a POST method was misused for data retrieval (i.e. instead of using a GET method) and i have worked on a project when a GET did include a payload...., but both these were due to devs not knowing what they're doing and no code reviews in place and got them sorted once i'd raised defects on them.
    If you consider most REST clients, they don't even include the facility to submit a payload in a GET request.

    I'd double check the technical requirements and if they are misusing an http method, i'd go back to the devs and point them to any solution or technical architect....they would never allow this.

    Cheers,

    richie