-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoptions.js
More file actions
31 lines (27 loc) · 735 Bytes
/
Copy pathoptions.js
File metadata and controls
31 lines (27 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
'use strict';
function Options(opt) {
if(!opt.hostname) {
this.headers = {
'Content-Type' : opt.contentType,
'Authorization' : opt.Authorization
};
} else if(opt.contentLength) {
this.headers = {
'Authorization' : opt.Authorization,
'Dropbox-API-Arg' : opt.headerPath,
'Content-Type' : opt.contentType,
'Content-Length' : opt.contentLength
};
} else if(opt.headerPath) {
this.headers = {
'Authorization' : opt.Authorization,
'Dropbox-API-Arg': opt.headerPath
};
}
this.hostname = opt.hostname ||'api.dropboxapi.com';
this.port = opt.port || 443;
this.path = opt.path;
this.method = 'POST';
return this;
}
module.exports = Options;