Postman - File name from "Send and Download" - postman

In Postman, how can I control the name of the file that is downloaded from using the "Send and Download" option? It is always "response" but I want it to be the actual name of the file that is sent over.

Response is not your fault. This issue is being actively worked on. Currently, it will not respect your headers in the response.
You can track this issue here:
https://github.com/postmanlabs/postman-app-support/issues/2082

I just looked this up in Google and it seems they still haven't added this option in Postman.
Here's the Github issue, and it's last updated 4 days ago.
https://github.com/postmanlabs/postman-app-support/issues/2082
Hope this will be helpful for someone who is coming across this page.

Postman has resolved this issue; by modifying the 'Content-Disposition' response header in your server you can control the name of the downloaded file.
Sample rails code:
def show
if request.headers['Accept'] == 'application/pdf'
send_data #document.read_file(:pdf)
# response.headers['Content-Disposition] == "attachment" # send_data sets this initially
response.headers['Content-Disposition'] += '; filename="document.pdf"'
else
respond_with #document, params
end
end

Related

Sending a file to an API using Postman form-data

I'm attempting to send a file to an API I've been developing through Postman, but the API has repeatedly failed to receive it. I initially thought this was a middleware issue, and attempted to use different modules to fix it. However, I have since realized that this is actually an issue in Postman itself
When I send the request and then review the request body in the Postman console, I can see that it fails to send the file at all, listing it as undefined.
I have seen a few people having this same issue, but was not able to find a solution that worked for me. I have already tried unchecking the Content-Type header, as well as closing and reopening the tab and Postman.
EDIT: I did not receive an answer to this, but I was able to find a workaround - coding a super basic html form that made a post request to the relevant endpoint. This did work, so I'm going to say this is likely a bug or settings issue in Postman itself, rather than something to do with my server's code.
Pretty sure you were in this thread already, but just in case,
this answer, and this one might be what you need.

Why can't I "PUT" data on JSONPlaceholder through Postman?

I am trying to put data on JSONPlaceholder through Postman, as seen in the screenshot:
But I could not find that data on JSONPlaceholder..
Did I do anything wrong or did the website just ignored my PUT request silently?
Have a look at JSONPlaceholder Guide under "Creating a Resource".
You will find a note that states:
Important: resource will not be really updated on the server but it will be faked as if.
Your request works (Status Code: 201) but the resource is not actually created.
JSONPlaceholder Guide
Put Method
Important: resource will not be really updated on the server but it will be faked as if.

Giving value to parameter from a file to send it through HTTPPOst

I have been struggling with Jenkins lately, and I'm stuck because I wanna send some parameters through HTTP Post, and I know how to do it, but the thing is that I am saving a Http request response to a file in my workspace, and then I want to use that file, read it and send the text I saved previously to a new HTTP Request, does anyone have any idea how can I achieve this?
Thanks in advance!!!
Install copy artifacts from another project plugin ( copy artifacts) add in build steps store the file in your workspace then you can run a shell script to read the desired content from that file .
if curl would work, that would be a simple way to send a file's contents as your POST body. see this answer.
Jenkins can work with Jmeter and Jmeter is great tool for handling request and response see tutorial

Qt GET request strange response

I'm writing a program to log into a game a get some information from the account.
After making a post request with username and password, I make a get request in the same location in order to download the needed html source.
However, doing qDebug()<<QString(reply->readAll());
prints "\u001F?\b" ,instead of the entire source code of the page.
The get reply has status code 200, and the error() function returns NetworkError(NoError).
For the post and get requests I'm using header information obtained from chrome's network tab in developer options combined with cookies obtained from previous response headers.
I'm doing a get request after the log-in post request because that's what seems to happen in the actual webpage, as displayed in developer options.
The response might be gzipped. Does unzipping happen to yield the expected result?

Mailgun send via HTTP API doesn't seem to send

I am trying to use Mailgun to send via the HTTP API as follows:
Python:
def send_simple_message(string):
return requests.post(
"https://api.mailgun.net/v2/samples.mailgun.org/messages",
auth=("api", "my-key"),
data={"from": "<me#mydomain.com",
"to": ["to#recipient.com"],
"subject": "",
"text": string})
My domain is verified using the CNAME records supplied, and I tried sending a couple of test strings.
Nothing visible happened, at all, from my Python script - didn't appear in sent items (gmail). So I tried manually via Terminal, and got the response: <Response [404]>.
Updating the address to mydomain.com (thanks #kwatford) I get <Response [200]> (success).
However, this was a test email I sent to myself (on a different address). I have not received the message, and it is not in the sent box of me#mydomain.com either. What have I done wrong?
Thanks to #kwatford for identifying the issue, exact solution as follows for anyone else confused by the example:
https://api.mailgun.net/v2/samples.mailgun.org/messages should be replaced by:
https://api.mailgun.net/v2/yourdomain.com/messages.
What I initially tried for a [200] response was simply http://mydomain.com which is incorrect.
Further, I was wrong to expect it to appear in sent items, though it does appear (now that I have the correct POST address!) in cp > logs on mailgun.com