Invalid request format
See original GitHub issueIssue
I have an issue with the pinning of file/directory. When I use Postman, everything works fine, but with SDK I always receive an error Invalid request format
Code example:
const readableStreamForFile = fs.createReadStream('./data/1.dat');
pinata.pinFileToIPFS(readableStreamForFile)
.then((result) => {
//handle results here
console.log(result);
}).catch((err) => {
//handle error here
console.log(err);
});
Version
@pinata/sdk@1.1.10
Issue Analytics
- State:
- Created 3 years ago
- Comments:43 (7 by maintainers)
Top Results From Across the Web
Invalid Request Format Error - OutSystems 11 Documentation
You have an invalid value set in the 'Request Format' property of a REST API method, or you don't have any value set...
Read more >403 - Invalid format - Rebrandly
403 - Invalid format · Request body is ill-formed e.g. invalid JSON · Required parameters are missing (either in body or in query...
Read more >400 Bad Request - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 400 Bad Request response status code indicates that the server cannot or will not process the request ...
Read more >c# - "Request format is invalid" - Stack Overflow
When trying to connect to the following web method, "Request format is invalid" is returned: public string myWebMethod(string test) { return ...
Read more >Invalid requests and error responses - BMC Documentation
This section illustrates the XML format for an error request and response. The following figure shows a sample invalid request for the Find...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found it !
Basically the Pinata API complains if you don’t provide a filename for the file you want to pin. The hint was to look at the “Pin Manager” where file names are displayed for every upload.
@obo20 I believe the documentation / recipe book should point out this edge case or the API should return a better error message.
@eightyfive Man, I can’t thank you enough ❤️ I approve his solutions works the best