Questions tagged [http]

HyperText Transfer Protocol - a textual system for representing web requests and replies.

A method of structuring human-readable requests and replies of web servers and their clients which provides at least these features: 1) standardized numeric result codes 2) extensible options 3) statelessness 4) compatibility with networking - reply length known or ability to stream limited or unlimited replies. 5) encoding binary data in readable form.

382 questions
12
votes
5 answers

Why don't HTTP headers include device resolution, pixel density, etc.?

I'm currently developing a responsive website with CSS media queries. It would be much easier if the server returned a different HTML/CSS for each viewport. I was wondering why couldn't the client include its viewport information when requesting an…
eliocs
  • 275
  • 1
  • 2
  • 5
8
votes
1 answer

HTTP code for action required

Suppose that I've an API that publishes a post in my Facebook account. What HTTP code should I return if the user hasn't linked yet his FB account with my API server (it's just an example)? I found "412 Precondition Failed" but I think that this is…
3
votes
2 answers

How should an HTTP server respond to a GET of an absolute URI of a different server?

I'm implementing a custom HTTP 1.1 server. According to Page 35 of RFC 2616, an HTTP Request URI may take one of four forms. One of these forms is "absolute-URI", which is exactly what it sounds like. Let's say I have a server at…
Ephemera
2
votes
0 answers

Differentiating HTTP bot traffic from regular users

I run a quite small website and I'd like to have some analytics about the traffic it gets from regular users. And I'd like to continue allowing bots to scrape it. I don't really care enough to invest in trying to detect bad-acting bots masquerading…
Joe K
  • 139
2
votes
0 answers

Why do RFCs use the term 'HTTP protocol'?

Several RFCs use the term 'HTTP protocol' (example). However, the acronym 'HTTP' already includes the word 'protocol' in it. Hence, isn't it redundant (and hence incorrect) to use 'HTTP protocol', whereas the correct usage would be simply…
Utku
  • 1,922
  • 4
  • 18
  • 19
2
votes
1 answer

How to avoid server-pushing assets to clients that already have them cached?

HTTP/2 server push enables pushing assets to clients which you anticipate they'll need in order to render the page. For example, you can push your CSS/JS/images to the client at the same time as you respond to a request for an HTML page, so they…
callum
  • 10,417
1
vote
3 answers

What sort of http error code to return when the request is bad AND there is an error on the server?

Some of the checks I make to validate http requests involve making a call to an external service to parse part of the request body. These calls can fail because of network connectivity issues. My feeling is that I should return a 5xx error to…
1
vote
1 answer

Currently serving big file (1.2GB) using HTTP/1.1, will HTTP/2 give better performance?

I have the single big file (1.2GB+) hosted on the server to download currently served using HTTP/1.1. We are exploring if we can move to HTTP/2 for better performance and security. All the places on the internet I see people talking about…
1
vote
1 answer

Converting HTTP requests to MQTT and back again for smart home integration

We have an already running MQTT setup for communication between smart home devices and remote server, for remotely controlling the devices. Now we want to integrate our devices with Google Home and Alexa. These two use HTTP for communication with…
0
votes
1 answer

When can an HTTP header have a non-string binary value?

The Browser Extensions Standard (which is based on the Chrome Extension API) includes a webRequest API with methods onBeforeSendHeaders and onHeadersReceived, allowing a browser extension to see and modify HTTP headers in requests and responses. The…
callum
  • 10,417
0
votes
1 answer

Alternatives to Request For Comments

I personally find RFC's quite difficult to read. They tend to be quite long, not precise enough, really old and for the most part, quite difficult to convert into actual working code. I think the evidence that I'm not the only one is quite large…
anon
-2
votes
3 answers

Why does the HTTP protcol support multiple methods?

This is a question which I have had in the back of my mind for a significant length of time, but never found an answer to, and never thought to directly ask - until today. I am interested to understand why HTTP supports multiple different methods,…
user3728501
  • 270
  • 1
  • 2
  • 9