com.buession.httpclient.core.RequestBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of buession-httpclient Show documentation
Show all versions of buession-httpclient Show documentation
Buession Framework Http Client
The newest version!
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License.
*
* =========================================================================================================
*
* This software consists of voluntary contributions made by many individuals on behalf of the
* Apache Software Foundation. For more information on the Apache Software Foundation, please see
* .
*
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.httpclient.core;
import java.net.URI;
import java.net.URL;
import java.util.List;
import java.util.Map;
/**
* 请求构建器
*
* @param
* {@link Request} 具体实现
*
* @author Yong.Teng
* @since 2.0.0
*/
public interface RequestBuilder {
/**
* 设置协议及版本
*
* @param protocolVersion
* 协议及版本
*
* @return 请求构建器
*/
RequestBuilder setProtocolVersion(ProtocolVersion protocolVersion);
/**
* 设置请求 URL
*
* @param url
* 请求 URL
*
* @return 请求构建器
*/
RequestBuilder setUrl(String url);
/**
* 设置请求 URL
*
* @param url
* 请求 URL
*
* @return 请求构建器
*
* @since 2.3.0
*/
RequestBuilder setUrl(URL url);
/**
* 设置请求 URL
*
* @param uri
* 请求 URL
*
* @return 请求构建器
*
* @since 2.3.0
*/
RequestBuilder setUri(URI uri);
/**
* 设置请求头
*
* @param headers
* 请求头
*
* @return 请求构建器
*/
RequestBuilder setHeaders(List headers);
/**
* 设置请求参数
*
* @param parameters
* 请求参数
*
* @return 请求构建器
*/
RequestBuilder setParameters(Map parameters);
/**
* GET 请求构建
*
* @return 请求构建器
*/
RequestBuilder get();
/**
* POST 请求构建
*
* @param body
* 请求体
*
* @return 请求构建器
*/
RequestBuilder post(RequestBody> body);
/**
* PATCH 请求构建
*
* @param body
* 请求体
*
* @return 请求构建器
*/
RequestBuilder patch(RequestBody> body);
/**
* PUT 请求构建
*
* @param body
* 请求体
*
* @return 请求构建器
*/
RequestBuilder put(RequestBody> body);
/**
* DELETE 请求构建
*
* @return 请求构建器
*/
RequestBuilder delete();
/**
* CONNECT 请求构建
*
* @return 请求构建器
*/
RequestBuilder connect();
/**
* TRACE 请求构建
*
* @return 请求构建器
*/
RequestBuilder trace();
/**
* COPY 请求构建
*
* @return 请求构建器
*/
RequestBuilder copy();
/**
* MOVE 请求构建
*
* @return 请求构建器
*/
RequestBuilder move();
/**
* HEAD 请求构建
*
* @return 请求构建器
*/
RequestBuilder head();
/**
* OPTIONS 请求构建
*
* @return 请求构建器
*/
RequestBuilder options();
/**
* LINK 请求构建
*
* @return 请求构建器
*/
RequestBuilder link();
/**
* UNLINK 请求构建
*
* @return 请求构建器
*/
RequestBuilder unlink();
/**
* PURGE 请求构建
*
* @return 请求构建器
*/
RequestBuilder purge();
/**
* LOCK 请求构建
*
* @return 请求构建器
*/
RequestBuilder lock();
/**
* UNLOCK 请求构建
*
* @return 请求构建器
*/
RequestBuilder unlock();
/**
* PROPFIND 请求构建
*
* @return 请求构建器
*/
RequestBuilder propfind();
/**
* PROPPATCH 请求构建
*
* @param body
* 请求体
*
* @return 请求构建器
*/
RequestBuilder proppatch(RequestBody> body);
/**
* REPORT 请求构建
*
* @param body
* 请求体
*
* @return 请求构建器
*/
RequestBuilder report(RequestBody> body);
/**
* VIEW 请求构建
*
* @return 请求构建器
*/
RequestBuilder view();
/**
* WRAPPED 请求构建
*
* @return 请求构建器
*/
RequestBuilder wrapped();
/**
* 构建请求 {@link Request}
*
* @return 请求 {@link Request}
*/
R build();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy