Request npm not working correctly


#1

Hi,

I am pretty new to the node.js (I just started learning it two or three weeks ago) and I recently want to make a request to an API. When I run the runkit notebook directly (without endpoint) which uses “Request” npm, the request is always carried out. However, when I tried to export the endpoint and run the same notebook using the endpoint url, the notebook returns what is supposed to be returned but without carrying out the request. So, I tried refreshing the page (with endpoint url) and on the third time, the request is carried out without a problem. Next, I waited some time before refreshing again, and this shows up.

{
“error”: “unexpected_error”,
“message”: “Something unexpected happened. Please contact support@runkit.com. Please provide the case number 1e95234e-1af0-47ba-927b-b6acca713a2f”
}

When I looked into the endpoint log of the notebook, I found the error “socket hung up”. Since I am quite new to the node.js, I don’t know whether this is my fault or a bug in the runkit request. If this is my fault, how can I make an API request from the endpoint without having to reload three times before it works?

Thanks!

Edit: I tried refreshing my notebook endpoint page multiple times. Seems like the request is carried out starting from the third refresh. If I wait some time before refreshing, I have to refresh 3 times again for the request to be carried out.


#2

Hi there!

Can you share a link to your notebook?


#3

Here is the link to my notebook.
https://runkit.com/kht2000/5acc2ea8321c3a00121ec4b8