How to respond with error message when making AJAX calls
I have an app that wasn’t written by myself. If there is an error such as an invalid ID given as a parameter, I would return something like:
Rendering head :ok vs head :no_content. Any good practices?
Whenever I take in data and do something like delete a post, etc. I generally return head :no_content
.
Response Header for illegal file (format)
I have a simple upload-servlet and need to report if a file is illegal and has not been added.
Do web applications use HTTP as a transport layer, or do they count as an integral part of the HTTP server?
Given an HTTP server (e.g. Apache, IIS) and a web application (user code running in the server using PHP, ASP.NET and the likes), which of those can decide which HTTP status code to return for any request?
Do web applications use HTTP as a transport layer, or do they count as an integral part of the HTTP server?
Given an HTTP server (e.g. Apache, IIS) and a web application (user code running in the server using PHP, ASP.NET and the likes), which of those can decide which HTTP status code to return for any request?
HTTP error 404 or 500 from an internal call to a separate API?
I have an endpoint in API 1 (my api) that queries API 2 (another companies api) to view and edit objects stored in API 2’s database. API 1 is essentially acting as a wrapper service around API 2, providing some extra functionality.
Is Model a better place to set HTTP status code?
In MVC usually the controller sets whatever needs to be sent back to the client/View, including HTTP status code, e.g.: