Closed xiaoyao closed 8 years ago
To be honest I think a much much cleaner solution would be to move the headers
handling at gluahttp.go#L141-L145 to the bottom of the containing if statement. This way the other options don't overwrite these custom headers. This would allow you to fill form
with your encoded JSON and use headers
to set your own specific Content-Type
header (in this case application/json
). This would allow for many more cases than just JSON and prevents us from in the future having to another option called xmlBody
or ...Body
.
@cjoudrey what do you think?
That's it. You are right. It's such a terrible pr. Please don't stop me from laugh at it ^_^
@dongkui0712 No it's not terrible at all. Your code could definitely work and your pull request was better than many others I have seen. You even wrote a test. I didn't want to discourage you on your first pull request as I can clearly see you're a good programmer.
@erikdubbelboer Your words are encouraging. Thanks a lot. Have a nice day
Hi, many thanks for your excellent work in helpfull gluahttp. It's my first pr... excited!
It adds access to jsonBody(type: string) in http.Post(), so we can post a json object in string.