當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript request.del函數代碼示例

本文整理匯總了TypeScript中request.del函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript del函數的具體用法?TypeScript del怎麽用?TypeScript del使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了del函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: reject

		AlbumFile.findById(fileId, (findErr: any, file: IAlbumFile) => {
			if (findErr !== null) {
				reject(findErr);
			} else if (file === null) {
				reject('file-not-found');
			} else if (file.user.toString() !== user.id) {
				reject('file-not-found');
			} else {
				request.del({
					url: `http://${config.fileServer.ip}:${config.fileServer.port}/delete`,
					form: {
						passkey: config.fileServer.passkey,
						path: file.serverPath
					}
				}, (err: any, _: any, res: any) => {
					if (err !== null) {
						return reject(err);
					}
					file.isDeleted = true;
					file.save((saveErr: any, saved: IAlbumFile) => {
						if (saveErr !== null) {
							return reject(saveErr);
						}
						resolve(saved.toObject());
					});
				});
			}
		});
開發者ID:akionux,項目名稱:Misskey-API,代碼行數:28,代碼來源:delete.ts

示例2: it

	it('should return delete (use @del, not @delete)', (done) => {
		request.del(localBaseUrl + '/delete', (err, res, body) => {
			let data = assertResponse(err, res, body);
			assert.equal(data, 'delete');
			done();
		});
	});
開發者ID:igabesz,項目名稱:advanced-controllers,代碼行數:7,代碼來源:test-methods.ts

示例3: Promise

 return new Promise((resolve, reject) => {
     request.del(url, options, (error, response, body) => {
         if (error) {
             return reject(error);
         }
         resolve({response, body});
     })
 });
開發者ID:rajivnarayana,項目名稱:wowza-nodejs-sdk,代碼行數:8,代碼來源:request-promise.ts

示例4: Promise

 let promise = new Promise((resolve, reject) => {
   let relationshipEndpointString: string = _getNeo4jEntityUrl(relationshipOrRelationshipId, "relationship");
   request.del(relationshipEndpointString, requestOptions, (err, response, body) => {
     if (err) {
       reject(err);
     }
     if (response.statusCode !== 204) {
       reject(`Error deleting relationship. received invalid HTTP status code: ${response.statusCode}, and message: ${response.statusMessage}`);
     }
     resolve(true);
   });
 });
開發者ID:tpennetta,項目名稱:neo4j-typescript,代碼行數:12,代碼來源:index.ts

示例5: done

            (error: any, response: any, body: any) => {
                if (!error && response.statusCode == 200) {
                    var newPoint = JSON.parse(body);

                    request.del(`http://localhost:3000/api/points/${newPoint._id}`,
                        (error: any, response: any, body: any) => {
                            if (!error && response.statusCode == 200) {
                            } else {
                                done(`${response.statusCode} - ${error}\n ${body}`);
                            }
                        });
                } else {
                    done(error);
                }
            }
開發者ID:najor,項目名稱:ng2-md-arcgis,代碼行數:15,代碼來源:serverSocketTest.ts

示例6: deleteThing

 // delete  /{repositoryId}/thing/{thingId}
 public deleteThing(
     thingId: string,
     callback?: (error: any, response: any) => void) {
     var options = {
         url: this.rootUri + "/thing/" + thingId,
         headers: { 'AccessToken': this.accessKey }
     };
     request.del(options, function (error, response, body) {
         if (!error) {
             if (response.statusCode > 299) {
                 callback(response.statusMessage, null);
             }
             else {
                 if (body)
                     callback(null, JSON.parse(body));
                 else
                     callback(null, null);
             }
         } else
             callback(error, null);
     });
 }
開發者ID:iotiva,項目名稱:remochad_js,代碼行數:23,代碼來源:iotiva.ts

示例7: removeUser

 removeUser(username) {
    request.del(environment.API.REMOVE_USER + '?username=' + username, (err, res) => {
     return err || res;
   });
 }
開發者ID:benwfreed,項目名稱:eatlanta-client,代碼行數:5,代碼來源:e2e-util.ts


注:本文中的request.del函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。