Last active
November 15, 2017 08:53
-
-
Save SSARCandy/fc3f5a08ff35f10ad96b24d8ffcffce4 to your computer and use it in GitHub Desktop.
auto upload to phancer and get the result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const request = require('request-promise'); | |
const option = { | |
method: 'POST', | |
uri: 'http://phancer.com/upload?net=iphone_6', | |
formData: { | |
file: { | |
value: fs.createReadStream('image_.jpg'), | |
options: { | |
filename: 'image_.jpg', | |
contentType: 'image/jpg' | |
} | |
} | |
}, | |
}; | |
request(option) | |
.then((res) => { | |
console.log(res); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment