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

Write the json content type for API responses #607

Merged

Conversation

smarterclayton
Copy link
Contributor

Closes #604

@@ -62,6 +62,21 @@ func NewNotFoundErr(kind, name string) error {
return errNotFound(fmt.Sprintf("%s %q not found", kind, name))
}

type errAlreadyExists string
Copy link
Member

Choose a reason for hiding this comment

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

Two thoughts--

Does this type belong in this PR?

If yes, can you generalize this type with the errNotFound type instead of making them distinct types? (e.g., have an httpResponseCode which is 404 for MakeNotFound and 409 (?) for MakeAlreadyExists...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not - my bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will do the generalization with another issue - that's coming from some other prototyping I was doing and mixed my commits.

lavalamp added a commit that referenced this pull request Jul 24, 2014
Write the json content type for API responses
@lavalamp lavalamp merged commit 9e9d9b8 into kubernetes:master Jul 24, 2014
@lavalamp
Copy link
Member

Thanks!

@smarterclayton smarterclayton deleted the return_correct_content_type branch February 11, 2015 02:21
mqliang pushed a commit to mqliang/kubernetes that referenced this pull request Dec 8, 2016
mqliang pushed a commit to mqliang/kubernetes that referenced this pull request Mar 3, 2017
wking pushed a commit to wking/kubernetes that referenced this pull request Jul 21, 2020
add google analytics to kubectl book
linxiulei pushed a commit to linxiulei/kubernetes that referenced this pull request Jan 18, 2024
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.

HTTP Content-Type from apiserver is 'text/plain' when it should be 'application/json'
2 participants