0

I want to send below as a Multipart Form in API Body for a POST request:

Upload passing two attributes (KEY) with (VALUE) Send arquivo (KEY) with (file) How to do this using REST-Assured

multipart print https://ibb.co/0QQCkQv

attempts:

Response response = (Response)
given()
.relaxedHTTPSValidation()
.header("Content-Type", "multipart/form-data")
.formParam("tipo", "capital_relatorio_faturamento")
.multiPart("arquivo", file, "image/jpg")
enter code here
------------------------------
.formParam("arquivo", "image/jpg")
.multiPart("tipo", "capital_balanco_patrimonial")
.multiPart("arquivo",file)
-------------------------------
.header("Content-Type", "multipart/form-data")
.multiPart("tipo", "capital_comprovante_endereco")
.multiPart("arquivo",file)```

1 Answer 1

1

Try

.multiPart("tipo", "capital_balanco_patrimonial")
.multiPart("arquivo", file, "image/jpg")

Rest-assured will automatically add content-type for these.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.