Getting the Http Response from Http Call to Custom script

As asked on

I made a custom php script (see link above for source code) and I try from my meteor App to get te response from the script.

But for some reason when I try to console log the returned response in the callback I get the undefined.

The http call is done via this piece of code (full source code on the link above):

      let http_obj={
        console.log("Response:",response); //Response that is undefined

But the only value I get is the error even though the server return http status 200.

Also when I tried to increase the timeout I get the following error to my console:

Error: Can’t set timers inside simulations

Do you have any idea how to handle it?

I think first you want to make sure your API is working correctly. You can try using something like postman to simulate your post call.

For the http calls, I’m using Meteor HTTP and it’s working fine.

Actually I did the following script: to test the use case before writing the meteor app and works fine.

I see, well at least we know your API is good. Here is an example of what worked for me:

  const response = Meteor.http.get(iFramely.endpoint, {
      params: {
        iframe: true,
        omit_script: true,
        api_key: iFramely.api_key
    card =;

Here the Meteor.http is behaving like a sync function, and I just assign and read the returned response. I surround the call with try/catch to handle exceptions. Not sure it’s the best practice, but it’s working for me, I hope that helps.

Also, I’m running this on the server, make sure to check isServer flag when making those calls.

In the end I moved the Http Call to the server side and I syncronously get the result.
In a almosr exact way you did it.