ESOCKETTIMEOUT in Postman when sending request - node.js

I am not able to resolve this. Went through all the forum post with similar issues but nothing helped me resolve this issue. I am getting ESOCKETTIMEOUT when trying to send request in postman. I am sharing screenshot of my code along with error in postman:-
screenshot showing the code and error
My index.js

I finally found the culprit. All I had to do was to replace res.json with res.send on line 17 & 18. Appreciate Deekshith for taking time out to look into the problem. Thanks

Related

I get a code: 615 in weatherstack when I try to catch data

I did an application in node.js
http://api.weatherstack.com/current?access_key=mykey&query=New York
I have this error
{"success":false,"error":{"code":615,"type":"request_failed","info":"Your API request failed. Please try again or contact support."}}
Could you please help me?
Before It worked.
When I found a problem I did
changed API Access Key
I created a new account and use a different key - the same problem
I sent a letter to weatherstack
I didn't get a response.
Try to add this "" at the end of URL this worked for me

OpenAI API Quickstart tutorial - POST http://localhost:3000/api/generate 500 (Internal Server Error)

Im new to OpenAI's API and am following the Quickstart tutorial found here:
https://beta.openai.com/docs/quickstart/build-your-application
I just cloned their GitHub repo (git clone https://github.com/openai/openai-quickstart-node.git) and when I tried to run it, I got this error.
POST http://localhost:3000/api/generate 500 (Internal Server Error)
Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
I don't understand what I missed, any help would be greatly appreciated.
source code
Encountered the same issue.
I simply just forgot to do the step involving adding the API_KEY to the .env file.
Follow the instructions from the documentation, specifically the title labelled "Add your API key" (https://beta.openai.com/docs/quickstart/add-your-api-key).
I have attached a screenshot of the instructions here. It is quite clear.
Hopefully this works for you!
Edit:
Also encountered the same problem when doing large requests. If there is a large request to the OpenAI API (i.e returning many tokens), then it will also return this same error.

OData service can be called in Browsers but in Excel 2016

I got a sample servlet using Olingo lib: https://odata-demoservice.run.aws-usw02-pr.ice.predix.io/DemoService.svc/Products. It works fine in Chrome/IE/FF or in Postman. But when I query in Excel 2016/OS Windows 10 with the steps like:
New Query
From Other Sources
From OData Feed
Got the error like: "We encountered an error while trying to connect. Details: Invalid URI: The hostname could not be parsed"
Any ideas are appreciated.
Thanks
#RodolfoOliveira: yes, I resolved this issue. the reason is that when I deployed it to Cloud, the uri in metadata is still http. What I did is implement a CustomProcessor and correct the url.
More detail is here: https://issues.apache.org/jira/browse/OLINGO-758
just need to do the custom Processor. Do the same as the original source but change a bit about the url. Detail in here: https://olingo.apache.org/javadoc/odata4/org/apache/olingo/server/api/processor/DefaultProcessor.html
Register it with the Handler at first, then the issue should be solved.
ODataHttpHandler handler = odata.createHandler(edm);
handler.register(new CustomDefaultProcessor());
Hope this help.

Node.js Issues with TwitterBot

I created a twitter bot via the instructions here:
https://medium.freecodecamp.com/easily-set-up-your-own-twitter-bot-4aeed5e61f7f#.5ifmh6ihn
I keep getting an error "Cannot read property 'id_str' of undefined Query String". I don't know much about node.js and just want this thing to work. I googled the error and didn't find much help. I left a comment on the post and haven't received any response there. Any help?

How to send POST variables with Nipple on NodeJS

I am trying to use nipple to post to an url within my nodejs application, which itself is running on hapi.js
The documentation essentially doesn't seem to spell it out.
(https://www.npmjs.com/package/nipple)
I tried passing it as payload inside options but that, while not returning an error, returns a 400. Can someone provide a correct example doing a post using nipple?
Essentially, I have two variables that I need to send - let's call the var1 and var2.
Thanks!
That link says that the project has been renamed to wreck. On wreck's github, several of the tests are for a post requests, including this one:
https://github.com/hapijs/wreck/blob/master/test/index.js#L68
If you are still scratching your head, you could also try using curl or postman to sanity check your URL, regardless of any nipple/wreck errors. If that also gives you a 400, nipple/wreck may not be the culprit.

Resources