How to use the put function from request
Find comprehensive JavaScript request.put code examples handpicked from public code repositorys.
GitHub: LockerProject/Locker
180 181 182 183 184 185 186 187 188 189
if (err) { logger.log("error", "Tried to publish a screenshot to nonexistent package " + req.params.id); res.send(err, 400); return; } var putReq = request.put( { url:burrowBase + "/registry/" + req.params.id + "/screenshot.png?rev=" + body._rev , headers:{"Content-Type":"image/png", Authorization:"Basic " + auth._auth, "Content-Length":req.headers["content-length"]}, body:buffer
137
0
34
+ 3 other calls in file
GitHub: brainlife/warehouse
735 736 737 738 739 740 741 742 743 744 745
//datacite api doc > https://mds.test.datacite.org/static/apidoc //set / update the url associated with doi exports.doi_put_url = function(doi, url, cb) { console.log("registering doi url", url); request.put({ url: config.datacite.api+"/doi/"+doi, auth: { user: config.datacite.username, pass: config.datacite.password,
9
8
4
+ 175 other calls in file
190 191 192 193 194 195 196 197 198 199
var url = this.baseApiUri + this._setAccessToken(path); var options = this._generateReqOptions(url, path, body, 'PUT', headers); request.put(options, function onPut(err, response, body) { if (!handleHttpError(err, response, callback)) { if (body) { var obj = JSON.parse(body); callback(null, obj);
0
1
0
29 30 31 32 33 34 35 36 37 38 39
} }) const seed = (index, type, settings, callback) => { const payload = { url: baseUrl + '/' + index, body: JSON.stringify(settings) } request.put(payload, (err, response) => { // create the index first with potential custom analyzers before seeding should.not.exist(err) let started = 0 for (const key in seeds) { started++
0
0
1
+ 5 other calls in file
112 113 114 115 116 117 118 119 120 121
// the URL for the backend service should be set in configuration // using an environment variable. Here, the variable is passed // to npm start inside package.json: // "start": "BACKEND_URL=http://localhost:8082 node server.js", // changed to a put now that real data is being updated request.put( // first argument: url + data + formats { url: SERVER + '/event/like', // the microservice end point for liking an event body: req.body, // content of the form headers: { // uploading json
0
0
0
request.get is the most popular function in request (2246 examples)