How to download attachment with HTTP Response Handler library?

Answered

I did look through this section https://www.jetbrains.com/help/idea/http-response-handling-api-reference.html and this one as well https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html and this one too https://blog.jetbrains.com/phpstorm/2018/04/handling-reponses-in-the-http-client/

In short, none of them mentioned anything regarding how to handle response, that has `Content-Disposition` header indicating, that response is attachment and therefore e.g. browser triggers file download.

Can it be achieved at the moment or should it be a feature request?

Thank you.

5 comments
Comment actions Permalink

Hmmm. Not sure. Maybe it is one and the same. I see, that in provide case, response header is

Content-Disposition: form-data;

But in my case it is

Content-Disposition: attachment; filename="..."

Maybe it is same as

Content-Disposition: form-data; name="attachment"; filename="..."


If I disregard this, then it does look like what I was asking about.

0
Comment actions Permalink

As I can see, there may be different scenarios. The initial problem is that when you download the attachment, the response just prints in the console?

0
Comment actions Permalink

Correct. Well for me it just creates *.txt file at the moment. Like in case of a JSON response it create a timestamped .json file.

0
Comment actions Permalink

Thanks for the information. Please follow https://youtrack.jetbrains.com/issue/IDEA-239333, for updates. I've added a private comment to the issue for collecting more details.

0

Please sign in to leave a comment.