Comments (4)
Expanding here, where I have more than 140 characters:
You write
Error responses should include a common HTTP status code
That seems to indicate that the HTTP status code only has to be in the response text itself. I'd go further (or clarify it, if it's the intent anyway), and require that the response has the appropriate HTTP Status, and not just containing it within the text.
You may also want to not restrict it to just the 200/400/500 codes, as others may be valid as well, for example 405 or 403.
I can make a pull request with my proposed changes if you think that'd be helpful?
from api-standards.
Thanks for your input @colinfrei. Yes, please! Pull requests are definitely welcome!
You may be interested to take a look at page 10 - 12 of the Web API Design document referenced here. (You can download the doc from apigee.com.) This does a pretty good job summarizing our thinking about this section of the specs so far. This guidance sounds pretty solid to me, "Start by using the following 3 [codes: 200, 400, 500]. If you need more, add them. But you shouldn't need to go beyond 8."
If you recommend explicitly adding additional HTTP codes, I'd be interested to know which ones. If there are any particular use cases you have in mind here, it would be helpful to know more about these too.
from api-standards.
@colinfrei Just to clarify for myself what you're saying is that you want the doc to specifically lay out that the HTTP Status code in the body of the response match the HTTP Status in the Response Header?
from api-standards.
Just to invert Twitter's suggestion - this feels like a clear case of trying to solve a problem that doesn't exist. HTTP already tells me that my GET or what have you was "OK" by returning a 200. Why would we occupy bandwidth by sending me back a representation of what the HTTP already told me (by giving it to me in the first place).
That's not metadata - that's meta-meta. Uber meta.
from api-standards.
Related Issues (20)
- POST response format and behavior is not specified
- POST request payload, format, and behavior are not clearly specified
- Clarify how JSONP URLs are constructed
- Clarify file formats and use of Content-Type headers
- Recommend encoding type
- Recommend how capitalization is handled
- A few CDC Enhancements
- Consider using the IETF API-Problem specification for error messages HOT 1
- Thanks and FYI
- Extending guidelines to include APIs that need authentication and authorization
- Add rationale to some guidelines. HOT 3
- Broken link HOT 1
- License for the content
- Http Code In response Json is useless HOT 3
- Some questions on the directory structure HOT 1
- What is the license? HOT 2
- Write something about running multiple versions of the API
- JSONP
- Email confirmation RESTful api HOT 1
- Please update readme with correct apigee links HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-standards.