How to send file as a parameter of POST request in REST Client in IntelliJ?
Asked Answered
P

1

7

I want to send <MYURL>/myaddres?path=<MYPATH>&content=<MYCONTENT> to a service with editor based REST client in IntelliJ, but take the content of <MYCONTENT> from a file.

Is it possible?

Pasteurizer answered 25/4, 2019 at 14:14 Comment(0)
A
10

Yes, you should type the < symbol followed by the path to the file:POST

POST http://example.com:8080/api/html/post
Content-Type: application/json

< ./input.json

More info: https://www.jetbrains.com/help/idea/exploring-http-syntax.html#provide-request-body

Antisyphilitic answered 25/4, 2019 at 17:53 Comment(1)
Yes, but this will pass file as entire request body, not for a single parameter?Pasteurizer

© 2022 - 2024 — McMap. All rights reserved.