Are POST requests with Content-Disposition header supported in Postman? - rest

I did some research both in the Postman GUI (auto-completion for request headers which does not offer "Content-Disposition") and in learning.postman.com/docs and there is no mention of "Content-Disposition" request header. I am using this request header in a POST request to upload a PDF file to an existing document. The operation is successful. But this is currently being done in a Jersey REST client Java project. I'm trying to create a similar POST REST request in Postman as part of a test collection.
Any workaround for this or just not supported? The "standard" multipart/form-data example cited everywhere and including Postman docs/examples is not supported by this upload POST API.
The Java/REST client code was based on this SO code: Upload file via streaming using Jersey 2 only difference in my client I am using "application/pdf" as MediaType.

Related

Replicatiing post request from website form using postman returns 500 internal server error

I'm trying to replicate a post request done normally by a website form via postman but the server returns 500 error.
the form website URL that I'm dealing with is here.
what I have done so far is investigate the network request using chrome or safari dev tools, copy the request as cURL, import the cURL in postman and do the request.
what can be the possible reasons for the failure and what are the alternative ways to achieve the same result?
Postman Headers:
Most probably you must have used invalid request body. The browser shows parsed json body and you might have copied incomple request body.
To get full body click view source and copy the full content.

SOAP UI - Attaching a multipart file in request body of rest api

In SOAP UI, I need to attach a multipart file in a rest api. I have stored responses for this api. I have seen this ans but could not get much help. I know that multipart files are sent in form-data. The documentation talks about some "attachment tab" but I can't find that in my case as I have stored responses - this link gives an idea about my rest api.

multipart/form-data post request is not working on SoapUI but works fine in Postman

I'm testing a multipart/forma-data request to upload a file(image-jpg, doc, etc) in SOAP UI. It gives 200 success message but does not uploads the file. The same request is working fine through the Postman tool.
I followed the same steps which are mentioned at most of the forum's to resolve such issues with the attachments in SOAP UI. I am adding one of the link below which I referred while configuring this on SOAP UI.
soapUI: multipart/form-data REST request with file attachments
My configuration in SOAP UI is as below -
SOAP UI screenshot
The only difference I can see with respect to Postman is that the SOAP UI generates the boundaries for multipart-form-data differently. It does not add boundary end tag after the contents. I am not sure if that is an issue here.

Neo4j REST API Get request from browser vs Get method from REST Client

Neo4j API url is: http://localhost:7474/db/data
When I use Chrome visiting this url, which is a GET request. This is the response I got
But when I use the restful client such as POSTMAN to make a g request.
This is the response I got.
My questions are
Both are GET request to the same url. Why Chrome browsing get a html page in return but Postman Request get JSON Response in return.
How Neo4j does that?
Is Neo4j using user agent detection, and if it is a browser visiting, it will give HTML page as response. And if it is a rest client request, it will give json response?
Thanks!
They use media type negotiation header. For example when requesting this site my browser sends a header like that:
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
As you can see it accepts primarily html, if that's not available then xhtml, then pure xml, and if that's not available - it accepts whatever the server can throw at it. Neo4j's website tries to serve content in that order. Postman likely just specifies application/json, or nothing at all (the application determines the default media type then), hence the response.

How to remove HTML content from REST API response?

I have started to work with REST APIs - specifically JIRA REST APIs.
I'm using the API to get response to a JIRA query but the JSON response I am getting contains lot of HTML chunk inside it.
It is not clean enough as showcased here
How can I use it in such a way to get a proper JSON response?
I think, JIRA response in JSON format only if request is successful, if request has any error than it comes in HTML response. actually that html belongs to the JIRA's error page. So correct your request, you will not get any response in HTML fomat. :)