The tag has no usage guidance.

learn more… | top users | synonyms

4
votes
4answers
215 views

Proper RESTful web service response code usage

Assuming I create a RESTful web service that looks up a user in a database given the id as a parameter. If the user does not exist, should I return a 404 response (because user not found)? Or a 200 ...
0
votes
0answers
49 views

How to deal with it that not all HTTP response headers reach the browser?

Some companies use firewalls that filter unknown HTTP response headers. I've personally witnessed that a page used the default font instead of the chosen external Google font because the firewall was ...
2
votes
3answers
130 views

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.: class Controller { public function get(Request req, Response resp) { ...
1
vote
0answers
157 views

How to persist a session cookie in a PSR7 request/response middleware?

I am building a package that implements native-like sessions in a PSR7 middleware architecture. I created a middleware which is responsible to create and persist a session cookie. The session is also ...
-2
votes
2answers
188 views

How can I reduce http request while I have hundreds of images and thousands of users [closed]

I need an idea or concept how to reduce http request. Conditions: 1000s of users(android/iphone) active 100s of small images (150kb/image) to be fetched Simply by giving each image a hardcoded link, ...
0
votes
0answers
28 views

How http-caching works with form element?

As per MDN, the attributes only supported by form element are: accept-charset, action, autocomplete, enctype, method, name, novalidate and target. With the help of http response header properties ...
2
votes
2answers
477 views

Designing a REST API: setting business logic error codes in http headers or within the response payload

I am designing a REST api backend that is meant to be consumed by a javascript front-end. I am not sure how to communicate server-side business logic errors (e.g. a user trying to retrieve his ...
1
vote
3answers
184 views

Store generated image in database or generate it on server/client

I have been thinking what could be the fastest way to show base64/img data to the user, i could generate the data when the user is registered and then store it to database, or generate it every time ...
4
votes
3answers
624 views

Web Service and Message Queue

We're looking at creating a web services/REST API layer that will be consumed by web and mobile clients. To make the solution more robust I was considering putting the commands from PUT, POST, and ...
1
vote
2answers
180 views

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 ...
3
votes
0answers
76 views

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. For some reason i am not allowed to give a html-body back, so i need to use the response-header. ...
3
votes
1answer
1k views

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. For example: def destroy @post = Post.find_by(external_id: params[:post_id]) @post.destroy! ...
1
vote
1answer
2k views

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: (200 code) { "success": 0, "error": "The row ...
3
votes
2answers
161 views

Why HTTP Servers send information about themselves in HTTP Headers?

Most of the HTTP Servers I know send their application name and version in response http headers as default behaviour. (Nginx, IIS, Apache etc.) Of course we can change the default behaviour but I ...
3
votes
2answers
103 views

How should I specify locations where clients can resolve authorization problems in a REST API?

I'm working through an API design where a user's authentication will be verified by the presence of a valid forms authentication ticket in a session cookie. However, there are additional levels of ...
21
votes
2answers
4k views

Levels of user permissions in a RESTful API

Let's say I have a company that ranks the cutest cats on the internet. I offer a resource at /cats/ which provides users with the latest, cutest adorable cats. Users can either get just the top 3 ...
35
votes
8answers
31k views

When to use HTTP status code 404 in an API

I am working on a project and after arguing with people at work for about more than a hour. I decided to know what people on stack-exchange might say. We're writing an API for a system, there is a ...
4
votes
4answers
121 views

Should I write an integration test that verifies rate limits?

This test would call a web service over and over for about a minute to confirm that a particular response code is returned, notifying us of our rate limit being reached. Not only is it a very slow ...
3
votes
1answer
996 views

The Request/Response Cycle

When User A decides he want to pay a visit to http://example.com/ it all begins with a Request. A short moment later he is given a Response. In this cycle Request-Response a lot is going on, in ...
1
vote
3answers
3k views

Is path in Set-Cookie URL encoded?

I'm writing some code that sets cookies and I'm wondering about the exact semantics of the Set-Cookie header. Imagine the following HTTP header line: Set-Cookie: name=value; Path=/%20 For with path ...
1
vote
3answers
409 views

Which HTTP status codes are really OK?

I am writing an application to report to the user(devs) when their website fails. And what I mean by fails which is unfunctional or needs to report the problem to devs. I do understand that status ...
2
votes
1answer
631 views

Is Google's Page Speed not working fine?

I've been making small improvements to a public ASP.NET site that I have and have ran it through Google's online Page Speed several times. I have a specific problem, but something that really threw me ...
2
votes
1answer
6k views

REST and redirecting the response

I'm developing a RESTful service. Here is a map of the current feature set: POST /api/document/file.jpg (creates the resource) GET /api/document/file.jpg (retrieves the resource) DELETE /api/...
6
votes
1answer
4k views

RESTful HTTP OPTIONS request content

I'm having trouble determining what I might put in the body of a response to an OPTIONS request? are there conventions? standards? What do you put? do you just provide a list of other METHODS? should ...
9
votes
2answers
4k views

What are some best practices for cookie based web authentication?

I'm working on a small side project using CGI and Python (scalability is not an issue and it needs to be a VERY simple system.) I was thinking of implementing authentication using cookies, and was ...
1
vote
1answer
104 views

An application to get statistical data about HTTP Request/Response

I'm looking for an application which takes the address of a website, browses that website, and provides reports based on some user-defined criteria about the HTTP requests/responses. For example, this ...