• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Last Call - The RapidAPI Blog

  • Marketplace
  • Add Your API
  • About
  • Docs
    • API Glossary
  • Blog
    • API Tutorials
      • Google Sheets
      • Python
      • JavaScript
      • PHP
      • Java
      • Ruby on Rails
      • C#
    • Most Popular APIs
  • Teams
  • Sign Up
    • Log In
Blog > API Glossary: Glossary of API Terms & Programming Acronyms > POST – What is the POST Method?
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y

POST – What is the POST Method?

Table of Contents

  • POST REQUEST
  • What is POST Request Method?
  • POST Examples
  • POST vs GET
  • POST vs PUT

POST REQUEST

For effective interaction between clients (application) and servers (computer), there must be an efficient transfer of data. This is where HTTP comes in handy. It is designed in a way that allows information to be sent in a format that can be understood by both the client and the server. HTTP works as a request-response protocol between a browser/ application and a computer that hosts a website. Calling or submitting various HTTP requests can be done using multiple methods. The POST request is one of them.

What is POST Request Method?

POST is the HTTP method that is designed to send loads of data to a server from a specified resource. Most common HTML forms on the web operate using this request method. It usually transmits relatively small loads of data to a receiver. This method allows data to be sent as a package in a separate communication with the processing script. This means that data sent through the POST method will not be visible in the URL, as parameters are not sent along with the URI.

The format of an HTTP POST should have HTTP headers, followed by a blank line, followed by the request body. POST request can be used to submit a web form or upload a file, but it is critical to ensure that the receiving application resonates with the format being used. The Content-Type header indicates the type of body in the POST request.

POST Examples

For example, if you want to pass the username and password using the API URL, https://api.example.com/v2/login, which is used to authenticate the application.

Curl -X POST -H "Content-Type: application/json" 
-d '{"username":"abc","password":"abc"}' 
https://api.example.com/v2/login

You can also note down the username and password in a user JSON file

Curl -X POST -H "Content-Type: application/json" 
-d @user.json 
https://api.example.com/v2/login

POST vs GET

Although POST and GET are the most commonly used HTTP request methods, they have many differences.

While the HTTP POST method is used to send data to a server to create or update a resource, the HTTP GET method is used to request data from a specified resource and should have no other effect.

HTTP POST request provides additional data from the client to the server message body. On the other hand, the GET request incorporates all the required data in the URL. The method specified when information is transferred can determine how form data is submitted to the server. When it comes to POST, form data is visible within the message body of the HTTP request. On the other hand, if the method is GET, all form data is encoded into the URL and appended to the action URL as query string parameters.

POST request parameters can’t be saved in browser history, can’t be bookmarked, has no restriction on form data length, cannot be cached, and is more hack-proof. On the other hand, GET request parameters can be archived in the browser history, can be bookmarked, it is easier to hack, has restriction on form data length, and can be cached.

POST vs PUT

While both POST and PUT HTTP request methods seem to be sending data to a server inside the body, what makes them different? While the POST method is non-idempotent and its response can be cached, the PUT method is idempotent, and its responses are not cacheable.

5 / 5 ( 2 votes )

Add Your API

Browse APIs

« HTTP Request Methods – What are HTTP Requests?
SDK – What is a SDK? »

Check Out These APIs

API-NBA

API-NBA

All NBA Stats DATA, Games, Livescore, Standings, Statistics, Teams, Players, Seasons, Leagues. API-NBA IS NOW FREE


Connect to API

Get Video and Audio URL

Get Video and Audio URL

Get direct links to download video or audio files from almost any hosting website, like Youtube, Twitch, SoundCloud, etc with download api.


Connect to API

Open Weather Map

Open Weather Map

Get weather and weather forecasts for multiple cities. See more: https://openweathermap.org/


Connect to API

Recipe - Food - Nutrition

Recipe - Food - Nutrition

The spoonacular Nutrition, Recipe, and Food API allows you to access over 365,000 recipes and 86,000 food products. Our food ontology and semantic recipe search engine makes it possible to search for recipes using natural language queries, such as "gluten free brownies without sugar" or "low fat vegan cupcakes." You can automatically calculate the nutritional information for any recipe, analyze recipe costs, visualize ingredient lists, find recipes for what's in your fridge, find recipes based on special diets, nutritional requirements, or favorite ingredients, classify recipes into types and cuisines, convert ingredient amounts, or even compute an entire meal plan. With our powerful API, you can create many kinds of food and especially nutrition apps. Special diets/dietary requirements currently available include: vegan, vegetarian, pescetarian, gluten free, grain free, dairy free, high protein, low sodium, low carb, Paleo, Primal, ketogenic, FODMAP, and Whole 30. We will soon be adding Weight Watcher points, too.


Connect to API

Domainr

Domainr

Instant domain search. Documentation available at https://domainr.com/docs/api


Connect to API

webcams.travel

webcams.travel

The World's Largest Landscape Webcam API ***** Get webcams by categories, country, region or just nearby your location ***** Get timelapse slideshows for every webcam ***** Get an uncluttered webcam layer for your map


Connect to API

Reader Interactions

Primary Sidebar

Build amazing apps, faster.

Discover, evaluate, and integrate with any API. RapidAPI is the world’s largest API marketplace with over 1,000,000 developers and 10,000 APIs.

Browse APIs

Recommended Content

  • Most Popular APIs
  • Best Weather APIs
  • Top Facial Recognition APIs
  • 20 Tutorials on How To Create Your Own API

Footer

Learn

  • How to use an API
  • Skyscanner Travel API Overview
  • API Glossary
  • For Developers
  • For API Providers
  • About
  • Team
  • Jobs
  • Contact Us
  • API Directory
  • Press Room
  • Privacy Policy
  • Terms of Use

© 2019 RapidAPI. All rights reserved.