当前位置: 首页>>代码示例>>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;未经允许,请勿转载。