0

i want to form url with below "Raw Request" then send request to it in nodejs,how can i do this.


Raw Request:
-----------

POST /sky?api_key="" HTTP/1.1
Host: https://sky.in
Content-Type: application/json
Connection: close
Content-Length: 82
{"registration_ids":[""], "data":{"message":"Hello World!"}}


Thank you.

scionoftech
  • 608
  • 2
  • 9
  • 24

1 Answers1

0

You can use the request module:

var request = require('request')
request.post('https://sky.in/sky', {
  qs: {
    api_key: ''
  },
  json: {
    registration_ids: [],
    data: {message: 'Hello World!'}
  },
}, function (err, res, body) {
  // body contains the parsed JSON response
})
simo
  • 15,078
  • 7
  • 45
  • 59