Skip to content

Instantly share code, notes, and snippets.

@nippe
Last active November 9, 2015 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nippe/bd6d246c11d775075b64 to your computer and use it in GitHub Desktop.
Save nippe/bd6d246c11d775075b64 to your computer and use it in GitHub Desktop.
Formdata using request
var reqeustOptions = {
uri: urljoin(apiBaseUrl, apiBasePath, 'SMS'),
method: 'POST',
auth: {
user: 'username',
pass: 'pwd'
},
form: {
from: fromNubmer,
to: toNumber,
message: message
}
};
request(reqeustOptions);
var reqeustOptions = {
uri: urljoin(apiBaseUrl, apiBasePath, 'SMS'),
method: 'POST',
auth: {
user: 'username',
pass: 'pwd'
},
formData: {
from: fromNubmer,
to: toNumber,
message: message
}
};
request(reqeustOptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment