API access Flashcards
HTTPS.request
.request method helps to request fields so we can POST a response to the corresponding fields.
You have to ‘require’ https module in your nodejs script.
const https = require(‘https’);
HTTPS.request Syntax
const request = https.request(url , options, callback_function) . . . request.write(data); request.end( );
====> options include authorization (API keys, password); method (POST, GET); etc.
API fields
Read the documentations to find what kind of JSON needs to be arranged and what fields need to be set.
and then put them in a flat format JSON.
For example –
var data = {
email_address: asc@xyz.com,
fname: asc,
lname: jkl,
phn_no: { first: +454 232 676, second: +344 678 953 }
birthday: 3/6/78
}
Pay attention to the values of each field. They may be object or array or text fields.