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


Java RequestBuilder.delete方法代碼示例

本文整理匯總了Java中org.apache.http.client.methods.RequestBuilder.delete方法的典型用法代碼示例。如果您正苦於以下問題:Java RequestBuilder.delete方法的具體用法?Java RequestBuilder.delete怎麽用?Java RequestBuilder.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.http.client.methods.RequestBuilder的用法示例。


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

示例1: selectRequestMethod

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
protected RequestBuilder selectRequestMethod(Request request) {
    String method = request.getMethod();
    if (method == null || method.equalsIgnoreCase(HttpConstant.Method.GET)) {
        //default get
        return RequestBuilder.get();
    } else if (method.equalsIgnoreCase(HttpConstant.Method.POST)) {
        RequestBuilder requestBuilder = RequestBuilder.post();
        NameValuePair[] nameValuePair = (NameValuePair[]) request.getExtra("nameValuePair");
        if (nameValuePair != null && nameValuePair.length > 0) {
            requestBuilder.addParameters(nameValuePair);
        }
        return requestBuilder;
    } else if (method.equalsIgnoreCase(HttpConstant.Method.HEAD)) {
        return RequestBuilder.head();
    } else if (method.equalsIgnoreCase(HttpConstant.Method.PUT)) {
        return RequestBuilder.put();
    } else if (method.equalsIgnoreCase(HttpConstant.Method.DELETE)) {
        return RequestBuilder.delete();
    } else if (method.equalsIgnoreCase(HttpConstant.Method.TRACE)) {
        return RequestBuilder.trace();
    }
    throw new IllegalArgumentException("Illegal HTTP Method " + method);
}
 
開發者ID:zongtui,項目名稱:zongtui-webcrawler,代碼行數:24,代碼來源:HttpClientDownloader.java

示例2: delete

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
/**
 * Executes a DELETE request against the partner service.
 * 
 * @throws PartnerException
 */
@Override
public void delete()
{
    RequestBuilder request = RequestBuilder.delete( this.buildPartnerServiceApiUri() );
    this.send( request );
}
 
開發者ID:PartnerCenterSamples,項目名稱:Partner-Center-Java-SDK,代碼行數:12,代碼來源:PartnerServiceProxy.java

示例3: deleteDiskDrive

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
public RequestBuilder deleteDiskDrive(String diskDriveId, String stampId) {
    RequestBuilder requestBuilder = RequestBuilder.delete();
    addCommonHeaders(requestBuilder);
    requestBuilder.setUri(String.format(DISK_DRIVE, this.provider.getContext().getCloud().getEndpoint(), this.provider.getContext().getAccountNumber(), diskDriveId, stampId));
    return requestBuilder;
}
 
開發者ID:dasein-cloud,項目名稱:dasein-cloud-azurepack,代碼行數:7,代碼來源:AzurePackVolumeRequests.java

示例4: deleteVirtualMachine

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
public RequestBuilder deleteVirtualMachine(String vmId, String dataCenterId) throws InternalException {
    RequestBuilder requestBuilder = RequestBuilder.delete();
    addCommonHeaders(requestBuilder);
    requestBuilder.setUri(getEncodedUri(String.format(VM_RESOURCES, this.provider.getContext().getEndpoint(), this.provider.getContext().getAccountNumber(), dataCenterId, vmId)));
    return requestBuilder;
}
 
開發者ID:dasein-cloud,項目名稱:dasein-cloud-azurepack,代碼行數:7,代碼來源:AzurePackVMRequests.java

示例5: deleteSubnet

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
public RequestBuilder deleteSubnet(WAPSubnetModel subnetModel){
    RequestBuilder requestBuilder = RequestBuilder.delete();
    addCommonHeaders(requestBuilder);
    requestBuilder.setUri(String.format(VM_SUBNET, this.provider.getContext().getEndpoint(), this.provider.getContext().getAccountNumber(), subnetModel.getId(), subnetModel.getStampId()));
    return requestBuilder;
}
 
開發者ID:dasein-cloud,項目名稱:dasein-cloud-azurepack,代碼行數:7,代碼來源:AzurePackNetworkRequests.java

示例6: deleteVMNetwork

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
public RequestBuilder deleteVMNetwork(WAPVMNetworkModel networkModel){
    RequestBuilder requestBuilder = RequestBuilder.delete();
    addCommonHeaders(requestBuilder);
    requestBuilder.setUri(String.format(VM_NETWORK, this.provider.getContext().getEndpoint(), this.provider.getContext().getAccountNumber(), networkModel.getId(), networkModel.getStampId()));
    return requestBuilder;
}
 
開發者ID:dasein-cloud,項目名稱:dasein-cloud-azurepack,代碼行數:7,代碼來源:AzurePackNetworkRequests.java

示例7: deleteInternetGateway

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
public RequestBuilder deleteInternetGateway(WAPVMNetworkGatewayModel wapvmNetworkGatewayModel) throws InternalException {
    RequestBuilder requestBuilder = RequestBuilder.delete();
    addCommonHeaders(requestBuilder);
    requestBuilder.setUri(getEncodedUri(String.format(VM_NET_GATEWAY, this.provider.getContext().getEndpoint(), this.provider.getContext().getAccountNumber(), wapvmNetworkGatewayModel.getId(), wapvmNetworkGatewayModel.getStampId())));
    return requestBuilder;
}
 
開發者ID:dasein-cloud,項目名稱:dasein-cloud-azurepack,代碼行數:7,代碼來源:AzurePackNetworkRequests.java

示例8: deleteNatConnection

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
public RequestBuilder deleteNatConnection(WAPNatConnectionModel wapNatConnectionModel){
    RequestBuilder requestBuilder = RequestBuilder.delete();
    addCommonHeaders(requestBuilder);
    requestBuilder.setUri(String.format(NET_NAT_CONNECTION, this.provider.getContext().getEndpoint(), this.provider.getContext().getAccountNumber(), wapNatConnectionModel.getId(), wapNatConnectionModel.getStampId()));
    return requestBuilder;
}
 
開發者ID:dasein-cloud,項目名稱:dasein-cloud-azurepack,代碼行數:7,代碼來源:AzurePackNetworkRequests.java

示例9: deleteNatRule

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
public RequestBuilder deleteNatRule(String ruleId, String stampId) throws InternalException {
    RequestBuilder requestBuilder = RequestBuilder.delete();
    addCommonHeaders(requestBuilder);
    requestBuilder.setUri(getEncodedUri(String.format(NAT_RULE, this.provider.getContext().getCloud().getEndpoint(), this.provider.getContext().getAccountNumber(), ruleId, stampId)));
    return requestBuilder;
}
 
開發者ID:dasein-cloud,項目名稱:dasein-cloud-azurepack,代碼行數:7,代碼來源:AzurePackNetworkRequests.java

示例10: getDeleteDBRequestBuilder

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
private RequestBuilder getDeleteDBRequestBuilder(String uri, String databaseName) {
    RequestBuilder requestBuilder = RequestBuilder.delete();
    addCommonHeaders(requestBuilder);
    requestBuilder.setUri(String.format(uri, this.provider.getContext().getCloud().getEndpoint(), this.provider.getContext().getAccountNumber(), databaseName));
    return requestBuilder;
}
 
開發者ID:dasein-cloud,項目名稱:dasein-cloud-azurepack,代碼行數:7,代碼來源:AzurePackDatabaseRequests.java

示例11: delete

import org.apache.http.client.methods.RequestBuilder; //導入方法依賴的package包/類
/**
 * Performs DELETE request to specified path with query parameters
 *
 * @param path        request path
 * @param queryParams query parameters
 * @throws BadRequestException          in case HTTP response code is 400 - Bad request, the request was formatted improperly.
 * @throws UnauthorizedException        in case HTTP response code is 401 - Unauthorized, API Key missing or invalid.
 * @throws AccessForbiddenException     in case HTTP response code is 403 - Forbidden, insufficient permissions.
 * @throws ResourceNotFoundException    in case HTTP response code is 404 - NOT FOUND, the resource requested does not exist.
 * @throws InternalServerErrorException in case HTTP response code is 500 - Internal Server Error.
 * @throws CallfireApiException         in case HTTP response code is something different from codes listed above.
 * @throws CallfireClientException      in case error has occurred in client.
 */
public void delete(String path, List<NameValuePair> queryParams) {
    try {
        String uri = getApiBasePath() + path;
        LOGGER.debug("DELETE request to {} with params {}", uri, queryParams);
        RequestBuilder requestBuilder = RequestBuilder.delete(uri);
        requestBuilder.addParameters(queryParams.toArray(new NameValuePair[queryParams.size()]));
        doRequest(requestBuilder, null);
        LOGGER.debug("delete executed");
    } catch (IOException e) {
        throw new CallfireClientException(e);
    }
}
 
開發者ID:CallFire,項目名稱:callfire-api-client-java,代碼行數:26,代碼來源:RestApiClient.java


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