Skip to main content

HTTP & HTTPS

What is HTTP?

HTTP stands for Hypertext Transfer Protocol.
It is a communications protocol and is used to send and receive web pages and files over the internet.
HTTP works by using a user agent (e.g. a browser) to connect to a server. The server must be located using a URL or URI. This always contains http:// at the start. It normally connects to port 80 on a computer.

What is HTTPS?

HTTPS stands for Hypertext Transfer Protocol Secure. This is a more secure version of HTTP and starts with https:// at the beginning of the URL. It encrypts all the information that is sent and received. This can stop malicious users such as hackers from stealing the information and is often used on payment websites. HTTPS uses port 443 for communication instead of port 80.


What is an HTTP Request?

HTTP stands for Hypertext Transfer Protocol and is a way of sending messages from one computer to another computer over the internet.
An HTTP request is sent to a specific URL and consists of a VERB, a set of HTTP Headers and a Body or Payload.
An example HTTP request is:
GET https://http://testingkida.blogspot.com// HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/plain
Host: testingkida.blogspot.com/
User-Agent: Apache-HttpClient/4.5.4 (Java/1.8.0_144)
Accept: text/html,application/xhtml+xml


URL

URL is a Uniform Resource Locator and is the address we use to access websites and web applications. URLs occur most commonly to reference web pages (http), but are also used for file transfer (ftp), email (mailto), and other applications.

Request Verbs

Request VERB specifies the type of request e.g. GET, POST, PUT, DELETE.
A Web Browser will usually make GET requests and POST requests, whereas when working with HTTP APIs the typical HTTP Verbs used are: GET, POST, PUT, DELETE.
GET request, as the name suggests, asks for a resource or to read information from the server e.g. clicking on a link. GET requests are visible in the browser’s address bar.
POST request, on the other hand, supply information to the server e.g. submitting a login or registration form. To create an entity, we would use POST requests. Also, POST requests are not visible in the browser’s address bar.
PUT request is used to update information on the server. For example, an existing user wishes to update his password, then a PUT request is used.
DELETE request deletes information on the server.
Both POST and PUT requests would usually have a request body. GET and DELETE would not.

Request Headers

Request headers specify information such as the type of Browser, type of content in the message, and what type of response is accepted in return.

Request Body / Payload

A Payload is the body of the HTTP request or response.
A request body can be plain text, HTML, XML, JSON, Javascript, or a set of key-value pairs as form-data.
When browsing the Web, the Browser usually receives an HTML payload. This is the web page that you see rendered in the Browser.
Typically when working with an HTTP API we will send and receive JSON or XML payloads.
Not all HTTP messages can have payloads: POST and PUT can have payloads, GET and DELETE can not.

What is an HTTP Response?

When a request is sent to a server, the server returns a response. The response from the server tells you if your request was successful, or if there was a problem.
An HTTP response method is made up of three components: Response status code, response headers, response body.

Response Status Codes

  • 2xx for Success, the most common one is 200 which means “OK”.
  • 3xx for Redirection, the most common ones are 301 and 303 which mean “Permanent Redirect” and “Redirect for Undefined Reason”, respectively.
  • 4xx for Application Error, the most common ones are 403 and 404 which mean “Forbidden” and “Not Found”, respectively.
  • 5xx for Server Error, the most common one is 500 which means “Server Error”.



Comments

Popular posts from this blog

Mobile Application Testing Checklist

1. DEVICE SPECIFIC CHECKS 1.1  Can the app be installed on the device? 1.2 Does the app behave as designed/desired if there is an incoming call? 1.3 Does the app behave as designed/desired if there is an incoming SMS? 1.4 Does the app behave as designed/desired if the charger is connected? 1.5 Does the app behave as designed/desired if the charger is disconnected? 1.6 Does the app behave as designed/desired if the device goes to sleeping mode 1.7 Does the app behave as designed/desired if the device resumes from sleeping mode 1.8  Does the app behave as designed/desired if the device resumes from lock screen? 1.9    Does the app behave as designed/desired if the device is tilted? 1.10  Does the app behave as designed/desired if the device is shaken? 1.11 Does the app behave as designed/desired if a local message is coming from another app (think   of: calendar reminders, to-do task etc.). 1.12 Does the app behave as designed/desired if a push message i...

ERP Domain Knowledge

What is ERP ? ERP is an industry acronym for Enterprise Resource Planning. Broadly speaking, ERP refers to automation and integration of a company's core business to help them focus on effectiveness & simplified success.The Information Technology industry is renowned for its adoption of acronyms, which are often widely used, but not fully understood.  The term 'ERP' itself is not self-explanatory and refers to the business software that has been designed to record and manage your enterprise data. Main Purpose of ERP: The main objective of an ERP domain is to combine information and processes from all divisions of an organization and merge them to create a structured working system. It can either reside on a centrally placed server or on individual servers that are combined on a separate server. Use of ERP: ERP specifically describes software that is used to connect many aspects of a business together. One major use for ERP software is controlling a supply chain. Busine...

Introduction to Apache JMeter

Apache JMeter is a great open source application with awesome testing abilities. Web Server is a platform which carries loads of numbers of applications and users, so that it is necessary to know that how does it works or performs means; how effective it is to handle simultaneous users or applications. For example; how the “Gmail” supporting server will perform when numbers of users simultaneous access the Gmail account – basically have to do performance testing using performance testing tools like JMeter, Loadrunner etc. To check the high performance of the application or server, do high performance testing using JMeter for exceptional results. Before understanding Overview of JMeter , let us have a look on three testing approach, Performance Test : This test provides the best possible performance of the system or application under a given configuration of infrastructure. Very fast, it also highlights the change need to be made before application goes into prod...