POST Request
In this lesson, we will learn how to automate a POST request for different use cases.
We'll cover the following...
We'll cover the following...
In this lesson, we will discuss two variations of the POST Request:
- POST with string body
- POST request using POJO (Plain Old Java Object) class
HTTP POST request automation
In this lesson, we will discuss two variations of POST Request.
Example 1 – POST with a string body
HTTPMethod: POST- Target URL:
http://ezifyautomationlabs.com:6565 - Resource path:
/educative-rest/students - Message body: As a String Object
- Take a look at the code below:
Let’s understand the example code above.
The code above uses the TestNG and Rest Assured libraries for automating the HTTP POST request and sends a string message for creating a new resource.