Questions tagged [http-protocols]

The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed, collaborative, hypermedia information systems. It is a protocol to transfer or exchange hyper text

The Hypertext Transfer Protocol is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a stateless protocol that can be used for name servers and distributed object management systems, through extension of its request methods, error codes and headers.

HTTP concepts include (as the Hypertext part of the name implies) the idea that files can contain references to other files whose selection will elicit additional transfer requests. Any Web server machine contains, in addition to the Web page files it can serve, an HTTP daemon, a program that is designed to wait for HTTP requests and handle them when they arrive. For example, when you enter a URL

enter image description here

in your browser, this actually sends an HTTP command to the Web server directing it to fetch and transmit the requested Web page.

HTTP has been in use since 1990.

There are three basic features that make HTTP a simple but powerful protocol:

  • HTTP is connectionless: The HTTP client, i.e., a browser initiates an HTTP request and after a request is made, the client disconnects from the server and waits for a response. The server processes the request and re-establishes the connection with the client to send a response back.

  • HTTP is media independent: It means, any type of data can be sent by HTTP as long as both the client and the server know how to handle the data content. It is required for the client as well as the server to specify the content type using appropriate MIME-type.

  • HTTP is stateless: As mentioned above, HTTP is connectionless and it is a direct result of HTTP being a stateless protocol. The server and client are aware of each other only during a current request. Afterwards, both of them forget about each other. Due to this nature of the protocol, neither the client nor the browser can retain information between different requests across the web pages.

More reading : https://www.w3.org/Protocols/rfc2616/rfc2616.html
Image Reference : http://code.tutsplus.com

54 questions
74
votes
3 answers

How can I know if the request to the servlet was executed using HTTP or HTTPS?

I wrote a servlet in Java and I would like to know if the request to that servlet was executed using HTTP or HTTPS. I thought I can use request.getProtocol() but it returns HTTP/1.1 on both methods. Any ideas?
ufk
  • 30,912
  • 70
  • 235
  • 386
7
votes
2 answers

How do I create a websockets server in PHP?

I have been searching the internet for about two days now, trying to understand how web sockets work, I am relatively new at Javascript and PHP, seeing as I started about two or three months ago. I am extremely confused about what an Http protocol…
William Oliver
  • 1,412
  • 4
  • 24
  • 35
5
votes
1 answer

Python: How to download file using range of bytes?

I want to download file in multi thread mode and I have following code here: #!/usr/bin/env python import httplib def main(): url_opt = '/film/0d46e21795209bc18e9530133226cfc3/7f_Naruto.Uragannie.Hroniki.001.seriya.a1.20.06.13.mp4' …
Khamidulla
  • 2,927
  • 6
  • 35
  • 59
5
votes
6 answers

Is there an open source (read free) tool that allows me to see my browser's HTTP commands?

I am getting into HTTP protocol specifics and I would like to see/understand the calls my browser makes as it is being used. I use Firebug (with Firefox) to look at/debug AJAX interactions, etc, but don't see the full HTTP conversation. Is there…
Stick it to THE MAN
  • 5,621
  • 17
  • 77
  • 93
4
votes
3 answers

HTTP status code for "More user input please?"

I am designing a RESTful API and am using the usual HTTP status codes like 200, 404, 500, etc. Given the situation where occasionally the API will require additional data. When this event arises it needs to respond with a relevant status code so…
Lea Hayes
  • 62,536
  • 16
  • 62
  • 111
3
votes
1 answer

Make a post request through a tcp connection in c#

I am asking this question primarily to learn. First I tried to make a regular post request and I got this error: C#: Handling WebClient "protocol violation". Then I tried to make a raw connection to understand what was going on and end up being…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
3
votes
2 answers

How to use multiple method annotations on specific routes?

I know that there are discussions of what are the best practices for handling routes in Symfony2 (routing.yml vs annotations). Just let me mention, that I want to keep the way it is, using annotations. When I define multiple routes for a single…
nTOXIC
  • 143
  • 2
  • 12
3
votes
3 answers

Implementing an HTTP proxy

I would like to implement and HTTP proxy server to get a deeper understanding of some of the finer points of the protocol and learn some socket programming along the way but I don't want to implement a full-blown HTTP server. What are the relevant…
David K.
  • 6,153
  • 10
  • 47
  • 78
2
votes
1 answer

increase HTTP request connection timeout in spring boot

I'm going to send an array of about 5 millions of records in json format in my spring boot app . is there any way to increase http request timeout in order to prevent from connection timeout?
Pouria Saleh
  • 55
  • 1
  • 10
2
votes
1 answer

How to upload file through HTTP protocol with C++?

I'm going to upload files with C++, to a Java spring boot web server. I constructed the protocol looks like below (in plain text): POST /gallery/multimedia/uploadvideo HTTP/1.1 Host: 192.168.0.133:8981 Content-Type: multipart/form-data;…
Ted Yu
  • 1,784
  • 1
  • 10
  • 16
2
votes
1 answer

What is the format of HTTP 1.1 header values?

I read the rfc7230 section 3.2. After removing obsolete rules, the spec about header field is: header-field = field-name ":" OWS field-value OWS field-name = token field-value = *field-content field-content = field-vchar [ 1*( SP / HTAB )…
martixingwei
  • 199
  • 1
  • 1
  • 7
2
votes
1 answer

Avoid HttpWebRequest GET and ProtocolViolationException

Is there anyway to prevent HttpWebRequest.GetRequestStream from throwing an exception when the method is GET? I know that HEAD and GET should not contain a body in valid HTTP, but some servers accept bodies for these methods anyway (e.g.,…
Travis Parks
  • 8,435
  • 12
  • 52
  • 85
2
votes
1 answer

send login details via POST from android

I am trying to send user email address and password from my android app to the db to login via POST. On the server side, I get my data like this : $email = $_POST['email']; $password = clean($_POST['password']; And on the android side I send it…
cxzp
  • 652
  • 2
  • 14
  • 28
1
vote
2 answers

How to avoid file:// protocol and show images using http://

It seems we cannot show images on Google Chrome using file:// protocol. I think would be nice to have a way to load the file on a remote network such as file://my-network-computer/my-folder/my-file.jpg and render it as image on a asp.net page. Is it…
Junior Mayhé
  • 16,144
  • 26
  • 115
  • 161
1
vote
1 answer

HTTP client acting as a pseudo-server

Let's say I am going to deploy a server application that's likely to be placed behind a NAT/firewall and I don't want to ask users to tweak their NAT port mapping. In other words, connections to the server are impossible, but my app is a server…
mojuba
  • 11,842
  • 9
  • 51
  • 72
1
2 3 4