Node application - request & response

40 views
Skip to first unread message

SC

unread,
Apr 18, 2017, 8:42:02 PM4/18/17
to nodejs
Hi,

I have a nodejs application, in which I am making a call to another rest service.

When I directly call that rest service from a simple request response node application, it works just fine from the command line.

But when I make the same call from the application mentioned above, I do not get any response.

What could be going wrong?

Thanks,
SC

DaneiL

unread,
Apr 20, 2017, 3:17:44 PM4/20/17
to nod...@googlegroups.com
Are you using CORS?
maybe that could be the problem.
Did you try making a request using curl?

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/02a80c1c-f090-423e-9b5a-753be67e4b39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
[]'s

Zlatko

unread,
Apr 20, 2017, 3:18:10 PM4/20/17
to nodejs
Without any code, it's hard to say. What are you making the call with? Does your simple request/response node app work as a cli module or how did you do it? Can you call the other rest API from node REPL?

The problem could be in your code, or it could be that some of the libraries you required that overwrote or changed functionalities you use.

If you have that working simple req/res node app, can you make it a module? Super simple module - just export a "run" function, and then call that module/function from your main app - just to see what's going on. If this works from, say, cli, but not from your app, it's most likely that your main app changes some functionality that you use.

tpx1

unread,
Apr 20, 2017, 3:18:11 PM4/20/17
to nod...@googlegroups.com
Hi,

there could be many problems and without any code, it is hard to see,
where a problem might be. Check variables, if you hide the response
variable of your application in the response statement.

Another problem could be, that your application has to finish his work
in the callback of the request (REST-API). If you do the request, but
the application logic works not in the response callback, the request is
started, but not handled.

Ok, hope that helps a little bit.

Thomas
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to nodejs+un...@googlegroups.com
> <mailto:nodejs+un...@googlegroups.com>.
> To post to this group, send email to nod...@googlegroups.com
> <mailto:nod...@googlegroups.com>.
> <https://groups.google.com/d/msgid/nodejs/02a80c1c-f090-423e-9b5a-753be67e4b39%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages