gorequest
gorequest copied to clipboard
can't set http header or send request body
If I do the following then the query body can't send successful.
request := gorequest.New()
request.Post("http://address").
Send(`{"query":{"match_phrase":{"age":"327"}}}`).
Set("Content-Type", "application/x-www-form-urlencoded").End()
but if I do the following then the http header can't set successful.
request := gorequest.New()
request.Set("Content-Type", "application/x-www-form-urlencoded").
Post("http://address").
Send(`{"query":{"match_phrase":{"age":"327"}}}`).End()
See https://github.com/parnurzeal/gorequest/issues/76
you should call request.Post first or set flag SetDoNotClearSuperAgent