Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set content type header when payload is provided #153

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aziemski
Copy link

No description provided.

@aziemski
Copy link
Author

@tebeka can you rerun travis test? There was a problem with jdk installation

HTTP request sent, awaiting response... 404 Not Found
2019-01-16 11:57:38 ERROR 404: Not Found.
download failed
Oracle JDK 8 is NOT installed.

@tebeka
Copy link
Owner

tebeka commented Jan 16, 2019

Re-run, still an error

http/headers/headers.go Outdated Show resolved Hide resolved
http/headers/headers.go Outdated Show resolved Hide resolved
http/mediatypes/mediatypes.go Outdated Show resolved Hide resolved
http/mediatypes/mediatypes.go Outdated Show resolved Hide resolved
http/mediatypes/mediatypes.go Outdated Show resolved Hide resolved
remote.go Outdated
func newRequest(method string, url string, data []byte) (*http.Request, error) {
request, err := http.NewRequest(method, url, bytes.NewBuffer(data))
if err != nil {
return nil, err
}
request.Header.Add("Accept", jsonContentType)
if data != nil {
request.Header.Add(headers.ContentType, mediatypes.ApplicationJSONUtf8)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this was already broken, this needs a test.

Maybe we can modify one of the existing tests to include UTF-8 data in the payload?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants