HTTP Methods

In this lesson, we will discuss curl command, an overview of an URL, and the most commonly used HTTP methods.

What is the curl command?

The curl command is a command-line tool used to transfer data to or from a server, with the help of any of the supported protocols (HTTP, FTP, IMAP, POP3, SCP, SFTP, SMTP, TFTP, TELNET, LDAP or FILE).

The syntax for the curl command is as follows:

curl [options] [URL...]

You can read more about curl here.

  • curl is free and open-source

  • It supports various protocols

  • You can refer to GitHub for the latest source code of curl

  • Please refer to POST Request Using Curl

In this chapter, we will use the curl command to demonstrate the various HTTP methods.

Overview of a URL

HTTP resources are identified and located on the network by Uniform Resource Locators (URLs), using the Uniform Resource Identifiers (URIs) schemes HTTP and HTTPS.

A sample URL:

https://www.educative.io/explore

Here,

  • https – protocol ( Secure HTTP )
  • www – subdomain
  • educative.io – domain name
  • /explore – service end point

HTTP methods

HTTP methods are designed to enable communications between clients and servers. We will discuss the most commonly used HTTP methods in the next few lessons.

  • GET
  • POST
  • PUT
  • DELETE

Get hands-on with 1200+ tech skills courses.