khttp
khttp copied to clipboard
Content-Type header is overwritten.
It makes sense to set this for the user if they haven't provided it, but the fact that someone has provided data as a string does not make the content type text/plain. I was attempting to use this library to test some Graphql endpoints and unfortunately can't do it because of this.
It worked in the latest version for me!
I believe we've switched over to okhttp internally, feel free to close this if it's not an issue.
Is it that what you're doing?
val graphql = "{\"query\":\"query { viewer { login } }\",\"variables\":{}}"
post("http://localhost:8080", data = graphql, headers = mapOf("Content-Type" to "application/json"))