Create multiple records in one post request method

here is my code and payload
Payload

package restful_payload;

public class computer {

	public static String model() {
	    return "[\r\n"
	        + "  {\r\n"
	        + "    \"name\": \"Apple MacBook Pro 16\",\r\n"
	        + "    \"data\": {\r\n"
	        + "      \"year\": 2019,\r\n"
	        + "      \"price\": 1849.99,\r\n"
	        + "      \"CPU model\": \"Intel Core i9\",\r\n"
	        + "      \"Hard disk size\": \"1 TB\"\r\n"
	        + "    }\r\n"
	        + "  },\r\n"
	        + "  {\r\n"
	        + "    \"name\": \"DELL LATITUDE Pro 16\",\r\n"
	        + "    \"data\": {\r\n"
	        + "      \"year\": 2018,\r\n"
	        + "      \"price\": 2000.99,\r\n"
	        + "      \"CPU model\": \"Intel Core i9\",\r\n"
	        + "      \"Hard disk size\": \"1 TB\"\r\n"
	        + "    }\r\n"
	        + "  }\r\n"
	        + "]";
	}	
}

Code

package restful_api;

import org.testng.annotations.Test;

import io.restassured.RestAssured;

import org.testng.Assert;
import org.testng.annotations.Test;
import static io.restassured.RestAssured.*;
import io.restassured.RestAssured;
import io.restassured.path.json.JsonPath;
import restful_payload.computer;
import io.restassured.path.json.JsonPath;
public class CRUDITEM {
	
@Test

public void createcomp(){
RestAssured.baseURI="https://api.restful-api.dev";	
String postresponse =given().log().all().header("Content-Type","application/json")
.body(computer.model()).when().post("/object")
.then().log().all().statusCode(200)
.header("Server", "cloudflare").extract().response().asString();

System.out.println("RESPONSE OF THE POST METHOD IS:"+postresponse);

JsonPath js = new JsonPath(postresponse);
String compid = js.getString("id");
System.out.println("ID OF THE POST METHOD IS:"+compid);
	
}
}

Actual result - it is getting failed.
can someone help me?

Hey @flight-meteorologi11 :waving_hand:

Welcome to the Postman Community! :postman:

There seems to be a lack of overall context here, what are you trying to do? What the structure of your request in Postman? What’s the expected response based on this code?

The API seems very basic with only a few methods and routes - https://restful-api.dev/

I doesn’t look like its been implemented to add multiple items and only does single items.

Send a GET request to the /objects route would get the items and return an array:

I was trying to create(using POST) multiple record, i was not aware that it is only for single item.
I am new to Restapi trying my hand on coding.
Could you please provide few API where multiple item can be created. Thanks

There should be multiple different API available to you, depending on your context, if you do a Google search. It’s difficult to give a list of them.

You can also use the Postman Echo service to practice making requests against.