I want to send below as a form-data in API Body for a PUT request:
How to do this using REST-Assured
Attached is the screenshot Form-Data Image
How to make a POST Request using Rest Assured? Step 1: Create a Request pointing to the Service Endpoint. Step 2: Create a JSON request which contains all the fields. Step 3: Add JSON body in the request and send the Request. Step 4: Validate the Response. Once we get the response back, all we have ...
Step 1) The amount field is within an array with Key “statements” which is in turn in the list with key “result” Step 2) Rest Assured, provides a mechanism to reach the values in the API using “path” Step 3) The path to reach amounts is “result.statements.AMOUNT”.
Step 1) Create a method called getResponseStatus () Step 2) Use the same request structure used above. Copy and paste it. Step 3) Instead of logging it, we use the 'getStatusCode' inbuilt method of Rest Assured to fetch the status code value.
I want to send below as a form-data in API Body for a PUT request: You need to set desired content type i.e "multipart/form-data" and add the multipart request specs to the request. Eg. given () .contentType ("multipart/form-data") .multiPart ("file", "filename") .multiPart ("key", "value") .when () .put (endpoint);
You need to set desired content type i.e "multipart/form-data" and add the multipart request specs to the request. Eg.
given()
.contentType("multipart/form-data")
.multiPart("file", "filename")
.multiPart("key", "value")
.when()
.put(endpoint);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With