Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Use request accept header to distinguish json status #1063

Closed
tomwilkie opened this issue Jul 2, 2015 · 7 comments · Fixed by #1077
Closed

Use request accept header to distinguish json status #1063

tomwilkie opened this issue Jul 2, 2015 · 7 comments · Fixed by #1077
Assignees
Labels
Milestone

Comments

@tomwilkie
Copy link
Contributor

...instead of having a status-json url path.

@tomwilkie tomwilkie added the chore label Jul 2, 2015
@rade rade added this to the current milestone Jul 2, 2015
@rade rade changed the title Use request content type header to distinguish json status Use request accept header to distinguish json status Jul 5, 2015
@rade
Copy link
Member

rade commented Jul 5, 2015

@tomwilkie @squaremo Are we ok with just matching on .Headers(“Accept”, “application/json”), or do we want full-blown content negotiation? Which is hard in go.

rade added a commit that referenced this issue Jul 5, 2015
...instead if having a separate URL.

Closes #1063.
@rade
Copy link
Member

rade commented Jul 5, 2015

Are we ok with just matching on .Headers(“Accept”, “application/json”)

That's what I've done.

@rade rade closed this as completed Jul 5, 2015
@rade rade reopened this Jul 5, 2015
@rade rade self-assigned this Jul 5, 2015
@tomwilkie
Copy link
Contributor Author

Yes I think that sufficient. We're not expecting browsers to hit this endpoint, so full content negotiation is probably not required.

@bboreham
Copy link
Contributor

bboreham commented Jul 6, 2015

The JSON endpoint was specifically written for my browser to hit. Could you expand on what other use-cases you had in mind?

@tomwilkie
Copy link
Contributor Author

Your browser, or an app running in your browser?

@bboreham
Copy link
Contributor

bboreham commented Jul 6, 2015

Javascript running in my browser.

@tomwilkie
Copy link
Contributor Author

The javascript has control over the headers it sends, and therefore can request json if it wants it.

@rade rade modified the milestones: current, 1.1.0 Jul 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants