Skip to content

Instantly share code, notes, and snippets.

@2tanayk
Last active November 8, 2020 18:26
Show Gist options
  • Save 2tanayk/a64d8c62edde268cf1ec2e7dc8f2f4fd to your computer and use it in GitHub Desktop.
Save 2tanayk/a64d8c62edde268cf1ec2e7dc8f2f4fd to your computer and use it in GitHub Desktop.
Some notes on computer networking

What is HTTP(Hyper Text Transfer Protocol)? It is a protocol of the web which is responsible for communication between web servers and clients.Whenever you search for a website on the browser,submit a form on a website etc. you are using the HTTP (you are using one of its methods eg. GET,POST etc.) . It works via a request & response cycle. Requests & responses consists of header and a body.Each request can be thought of as a transaction. It is stateless ie all/any of the requests are independent of each other.It doesn't remember any of the previous requests while making a new one.(However,We can use cookies,local storage etc. to do save any information if needed.) HTTPS(Hyper Text Transfer Protocol Secure) is used to encrypt HTTP requests/responses for security purposes.The data is encrypted using SSL(Secure Sockets Layer) or TLS(Transport Layer Security) to protect sensitive information which is susceptible to MitM(man-in-the-middle) attacks.However its to be noted that HTTPS is just, much harder to crack but not 100% foolproof. eg. Instead of:

(HTTP) GET /hello.txt HTTP/1.1 User-Agent: curl/7.63.0 libcurl/7.63.0 OpenSSL/1.1.l zlib/1.2.11 Host: www.example.com Accept-Language: en The attacker sees something like:

(HTTPS) t8Fw6T8UV81pQfyhDkhebbz7+oiwldr1j2gHBB3L3RFTRsQCpaSnSBZ78Vme+DpDVJPvZdZUZHpzbbcqmSW1+3xXGsERHg9YDmpYk0VVDiRvw1H5miNieJeJ/FNUjgH0BmVRWII6+T4MnDwmCMZUI/orxP3HGwYCSIvyzS3MpmmSe4iaWKCOHQ==

commonly used HTTP methods: GET retrieves data from server(eg. loading a HTML webpage,JSON,XML etc.) POST submitting data to server to create a resource(eg. submitting a form,uploading file etc.) PUT update data already on the server(eg.editing a blog post etc.) DELETE deletes data from server(eg.deleting a comment,blog post etc.)

(more info :https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods)

As we already know the HTTP requests&responses have a header and a body,now lets dive a bit deeper into it:

The body in case of a response is for eg.HTML web page

Most HTTP requests are GET requests without bodies. However, simulating requests with bodies is important to properly stress the proxy code and to test various hooks working with such requests. Most HTTP requests with bodies use POST or PUT request method. eg. submitting a form

There a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment