Search
  • +44-7459919437 (UK- WhatsApp & Direct Call) | +91-6383544892 (India - WhatsApp Only) | Email Id : vinothrwins@gmail.com
Vinoth Tech Solutions
  • Home
  • Selenium Java Online Training
  • Self Paced Video Course
    • Selenium Course Curriculum
    • Cypress Course Curriculum
    • Playwright Course Curriculum
  • Tutorials
  • Demo Sites
    • Practice Automation
      • Demo Page Healthcare
      • Registration Form
      • Transaction Details
      • DropDown
      • Mouse Event
      • Keyboard Events
      • Alert and Popup
      • Multiple Windows
      • iFrames
      • Wait WebElement
      • WebTable
  • FAQS
  • About Me & Feedback
    • Placed Students Feedback
    • Online Training Feedback
    • LinkedIn Profile
    • TechTalk
  • Free YouTube Courses
    • Python for Automation
    • Free QA Video Courses
      • Manual Testing
      • Java For Automation
      • Selenium Webdriver
      • TestNG
      • Cucumber BDD
      • UFT(QTP) Automation
    • Free Data Science Courses
      • Artificial Intelligence for Beginners
      • Python For A.I
      • Python Pandas
      • Python NumPy
      • Mathematics for A.I
  • Home
  • Selenium Java Online Training
  • Self Paced Video Course
    • Selenium Course Curriculum
    • Cypress Course Curriculum
    • Playwright Course Curriculum
  • Tutorials
  • Demo Sites
    • Practice Automation
      • Demo Page Healthcare
      • Registration Form
      • Transaction Details
      • DropDown
      • Mouse Event
      • Keyboard Events
      • Alert and Popup
      • Multiple Windows
      • iFrames
      • Wait WebElement
      • WebTable
  • FAQS
  • About Me & Feedback
    • Placed Students Feedback
    • Online Training Feedback
    • LinkedIn Profile
    • TechTalk
  • Free YouTube Courses
    • Python for Automation
    • Free QA Video Courses
      • Manual Testing
      • Java For Automation
      • Selenium Webdriver
      • TestNG
      • Cucumber BDD
      • UFT(QTP) Automation
    • Free Data Science Courses
      • Artificial Intelligence for Beginners
      • Python For A.I
      • Python Pandas
      • Python NumPy
      • Mathematics for A.I

API Testing

  • What is an API?
  • Why is API Testing Important?
  • Advantages of API Testing
  • Disadvantages or Challenges of API Testing
  • Differences between API Testing, Unit Testing, and Integration Testing
  • Overview of XML 
  • Overview of JSON
  • Comparison between XML and JSON
  • What are API Methods?
  • What are HTTP Status Codes?
  • What is Web Service Testing?
  • Difference between API and WebService Testing
  • Types of APIs:
  • Request Headers and Parameters
  • Authentication and Authorization
  • API Keys for API Testing
  • OAuth Keys for API Testing
  • JWT (JSON Web Tokens) for API Testing
  • Creating Test Cases for API Functional Testing 
  • Advanced API Testing Techniques
  • Mocking and Stubbing APIs using postman api
  • Contract Testing for APIs
  • Overview of Popular API Testing Frameworks
  • API Testing Best Practices
View Categories
  • Home
  • Tutorials
  • API Testing
  • API Testing
  • What are API Methods?

What are API Methods?

What are API Methods?

HTTP Methods #

HTTP methods, also known as “verbs,” define the type of action to be performed on a resource. Here are the most commonly used HTTP methods:

1. GET #

  • Purpose: Retrieve data from the server.
  • Idempotent: Yes (multiple identical requests will yield the same result).
  • Sample Example: Fetching a list of users.
GET /users HTTP/1.1

Host: example.com

  • Response:
[

  {"id": 1, "name": "John Doe"},

  {"id": 2, "name": "Jane Smith"}

]

2. POST #

  • Purpose: Send data to the server to create a new resource.
  • Idempotent: No (sending the same request multiple times can create multiple resources).
  • Sample Example: Creating a new user.


POST /users HTTP/1.1

Host: example.com

Content-Type: application/json

{

  "name": "John Doe",

  "email": "john.doe@example.com"

}

  • Response:


HTTP/1.1 201 Created

Location: /users/1

3. PUT #

  • Purpose: Update an existing resource or create a resource if it doesn’t exist.
  • Idempotent: Yes (sending the same request multiple times will result in the same state).
  • Sample Example: Updating a user’s information.
PUT /users/1 HTTP/1.1

Host: example.com

Content-Type: application/json

{

  "name": "John Doe",

  "email": "john.newemail@example.com"

}

  • Response:
HTTP/1.1 200 OK

4. DELETE #

  • Purpose: Remove a resource from the server.
  • Idempotent: Yes (deleting a resource multiple times results in the same state, i.e., the resource being absent).
  • Sample Example: Deleting a user.
DELETE /users/1 HTTP/1.1

Host: example.com

  • Response:
HTTP/1.1 204 No Content

5. PATCH #

  • Purpose: Apply partial updates to a resource.
  • Idempotent: Yes (the same PATCH request will result in the same state).
  • Sample Example: Updating only the email of a user.
PATCH /users/1 HTTP/1.1

Host: example.com

Content-Type: application/json

{

  "email": "john.updated@example.com"

}

  • Response:
HTTP/1.1 200 OK

6. HEAD #

  • Purpose: Same as GET, but it only retrieves the headers, not the body.
  • Idempotent: Yes.
  • Sample Example: Checking if a resource exists without downloading it.
HEAD /users/1 HTTP/1.1

Host: example.com

  • Response:
HTTP/1.1 200 OK

Content-Length: 348

Content-Type: application/json

API Testing
What are your Feelings
Share This Article :
  • Facebook
  • X
  • LinkedIn
Comparison between XML and JSONWhat are HTTP Status Codes?
Table of Contents
  • HTTP Methods
    • 1. GET
    • 2. POST
    • 3. PUT
    • 4. DELETE
    • 5. PATCH
    • 6. HEAD
© 2018 – 2025 Vinoth Tech Solutions Ltd (UK), Reg. No: 16489105