Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

MJS callback error: [HTTP] is not defined

aravindmj97aravindmj97 INDIA
edited May 14 in Mongoose OS

I'm trying to do a http cloud function call from my NodeMCU, but im getting the error as in the title MJS callback error: [HTTP] is not defined. I'm coding NodeMCU using JavaScript. Couldn't find a solution for this. Please provide me with a solution.
This is my code

HTTP.query({
    url: 'https://.....',
    headers: { 'X-Foo': 'bar' },     // Optional - headers
    data: {foo: 1, bar: 'baz'},      // Optional. If set, JSON-encoded and POST-ed
    success: function(body, full_http_msg) { print(body); },
    error: function(err) { print(err); },  // Optional
  });

Comments

Sign In or Register to comment.