Skip to main content

Post Request using REST Assured

A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms.

public class ReqRes 

	public void setup()
		RestAssured.baseURI = "";
		RestAssured.basePath = "api";

	/*POST Request Example*/
	public void postRequestExam()
		Response res = 
			.header("Content-Type", "application/json")			
			.body("{\n" + 
					"    \"name\": \"Tarun Goswami\",\n" + 
					"    \"job\": \"QA\"\n" + 


    "name": "Tarun Goswami",
    "job": "QA",
    "id": "591",
    "createdAt": "2020-07-24T07:38:08.739Z"

Submitted by tgoswami on September 1, 2020

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.


At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.