POST example fails
See original GitHub issueIf I am using the POST example from the README verbatim (granted I know that the URL listed is not going to work), I get
curl.setOpt(curl.option.URL, AUTH_URL);
^
TypeError: Cannot read property 'URL' of undefined
To reproduce make a new file and paste in the example:
const { Curl } = require('node-libcurl');
const curl = new Curl();
const close = curl.close.bind(curl);
curl.setOpt(curl.option.URL, AUTH_URL);
curl.setOpt(curl.option.HTTPPOST, [
{ name: 'input-name', file: '/file/path', type: 'text/html' },
{ name: 'input-name2', contents: 'field-contents' }
]);
curl.on('end', close);
curl.on('error', close);
And try to run it
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
HTTP POST Request sometimes fails? - Support : GameSparks
"message: Error performing POST for the URL https://gamelift.us-east-1.amazonaws.com/:gamelift.us-east-1.amazonaws.com:443 failed to respond\" It's quite ...
Read more >What HTTP response code to use for failed POST request?
The reason why a POST request would fail is more of a business logic error, for example "account balance too low to withdraw...
Read more >jQuery.post() | jQuery API Documentation
This example fetches the requested HTML snippet and inserts it on the page. Pages fetched with POST are never cached, so the cache...
Read more >Best Practices for REST API Error Handling - Baeldung
In this tutorial, we'll learn about some of the best practices for handling REST API errors, including useful approaches for providing users ...
Read more >HTTP response status codes - MDN Web Docs - Mozilla
HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
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 Free
Top 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
Ah ok! Thanks! 👉 https://github.com/JCMais/node-libcurl/pull/199
You have to fork this repository on your Github account and then push to some branch there, this way Github will give you the option to open a pull request.
You can also edit the Readme file directly from Github UI and it will do most of this automatically for you.
From: Jochen Hartmann notifications@github.com Sent: Wednesday, November 27, 2019 12:12:46 PM To: JCMais/node-libcurl node-libcurl@noreply.github.com Cc: Jonathan Cardoso Machado well.bad@hotmail.com; State change state_change@noreply.github.com Subject: Re: [JCMais/node-libcurl] POST example fails (#195)
Looks like it won’t let me 😢
jochen@admins-MBP:~/Documents/node-libcurl$ git push origin readme-update
remote: Permission to JCMais/node-libcurl.git denied to vomc.
fatal: unable to access ‘https://github.com/JCMais/node-libcurl.git/’: The requested URL returned error: 403
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/JCMais/node-libcurl/issues/195?email_source=notifications&email_token=AAH6J3567TWPE36CGELTHR3QV2E65A5CNFSM4JSHANXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFJZ4AA#issuecomment-559128064, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAH6J34TBU73YWEG2ZK56YLQV2E65ANCNFSM4JSHANXA.