API access Flashcards

1
Q

HTTPS.request

A

.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’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

HTTPS.request Syntax

A
const request = https.request(url , options, callback_function)
.
.
.
request.write(data);
request.end( );

====> options include authorization (API keys, password); method (POST, GET); etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

API fields

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly