scalaj-http
scalaj-http copied to clipboard
Send a get request with body
Http("http://localhost:39180/api")
.method("GET")
.header("X", "test-app")
.asString
is there a way to send a request body with a get request? My app functions in such way that it needs a request body to be sent..
@nikitap95 @hoffrocket I'm also looking for an answer on this too - any solutions or ideas? Something similar or equivalent to the Python version of request.get('url', json='body')
You should be able to do this:
Http(url).postData(data).method("GET").asString
Not that it’s important for method to come after postData
@hoffrocket this does not seem to work for GET
. It seem to convert it into a POST
when actually sending it
It works fine with other methods like DELETE
though