forked from you-genie/temp_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.js
30 lines (24 loc) · 864 Bytes
/
client.js
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
var http = require("http");
var options = {
"method": "POST",
"hostname": "13.124.41.33",
"port": "2048",
"path": "/api/photo/Alice",
"headers": {
"content-type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
"cache-control": "no-cache",
"postman-token": "db514ed8-7488-ba42-0393-4279e2f62021"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"userfile\"\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
req.end();