Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var fs = require("fs");
- var request = require("request");
- var options = { method: 'POST',
- url: 'http://localhost:8000/admin/package/',
- headers:
- { 'cache-control': 'no-cache',
- Connection: 'keep-alive',
- 'content-length': '108246',
- 'accept-encoding': 'gzip, deflate',
- Host: 'localhost:8000',
- 'Postman-Token': '268879bd-0af7-4199-a9a6-63b14b9728d8,52a3a691-42c3-4e33-aa8a-01281f74b0d2',
- 'Cache-Control': 'no-cache',
- Accept: '*/*',
- 'User-Agent': 'PostmanRuntime/7.13.0',
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'content-type': 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' },
- formData:
- { description: 'package form data',
- title: 'test package form data',
- community: 'hihi',
- color_scheme: '#hahaha17',
- questions: '[{\n "answer": [\n "true"\n ],\n "options": [\n "string"\n ],\n "question": "string",\n "type": "string"\n }\n ]',
- image_background:
- { value: 'fs.createReadStream("/Users/haithanh079/Downloads/60548353_328063354545788_1343610377442689024_n.jpg")',
- options:
- { filename: '/Users/haithanh079/Downloads/60548353_328063354545788_1343610377442689024_n.jpg',
- contentType: null } } } };
- request(options, function (error, response, body) {
- if (error) throw new Error(error);
- console.log(body);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement