I am not able to upload a document or file in postman. I tried in form-data to upload the file. But its not working.
Also i tried to pull the file through raw body. But both im not able to proceed. I need some key value or exact key word to continue. One of the Error is as below.
{
"error": {
"code": "InvalidRequest",
"message": "Invalid Request.",
"innererror": {
"code": "EmptyRequest",
"message": "Request body must be present."
}
}
}
Hi Danny,
As of not im not using it as public as im a beginner to Postman. Im trying Text analytics using Azure. In this context i would like to upload some files to check.
What should be the key i should give as per the API Documentation?
If i change the content type as multipart form-data then the error is
âUnsupported content type âmultipart/form-dataââ
Can you help me with this information or you need more details?
I think Danny meant the documentation for the API.
For the Azure Text Analytics. (Rather than Postman documentation).
This will be down to what the API accepts. 4xx status codes mean the request is not in the correct format.
Pretty sure you wouldnât upload a JSON file using form-data.
When sending binary files using form data, you need select âfileâ as the key. (which you appear to be missing).
For exampleâŚ
However, this is all guess work without seeing the API documentation. Good documentation usually provides example request\responses. A lot of the Azure APIâs have Postman collections that you can download that all you need to do is plug your credentials into the appropriate environment variables.
This is the documentation im following.
I have already tried the way which you shared but not posted the screenshots here. Also im not using Public API.
Hope someone can guide me.
Thanks in advance.
Hi Mike,
Currently im looking into Analyse Text.
I have worked on giving the text directly in the body and it worked successfully. But now instead of giving text, I want to upload a file or a document. Here im getting one or the other error.
Only if the API accepts that. This isnât a Postman function. Form data and binary uploads are part of the http and web standards and your API will either support that or it wonât.
There is no-where in the API documentation that I could find that allows this for this type of file upload.
Have a look at the examples.
None of them are showing binary data, or form-data for that matter. They are all raw\JSON requests.