All Downloads are FREE. Search and download functionalities are using the official Maven repository.

wee0.net.IHttpClient Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2016-2022, wee0.com.
 *
 * Licensed 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.
 **/
package wee0.net;

import java.util.Map;

/**
 * HTTP客户端
 * @author		baihw
 * @date 		2018年7月1日
 **/

/**
 * 
 *  examples:
 * 
**/ public interface IHttpClient{ /** * 执行HEAD请求。 * * @param url 请求地址 * @param params 参数集合 * @param headers 要发送的请求头信息 * @return 响应对象 */ public IHttpResponse head( String url, Map params, Map headers ); /** * 执行GET请求。 * * @param url 请求地址 * @param params 参数集合 * @param headers 要发送的请求头信息 * @return 响应对象 */ public IHttpResponse get( String url, Map params, Map headers ); /** * 执行PUT请求。 * * @param url 请求地址 * @param mediaType 要发送的数据类型 * @param mediaData 要发送的数据 * @param headers 要发送的请求头信息 * @return 响应对象 */ public IHttpResponse put( String url, HttpMediaType mediaType, String mediaData, Map headers ); /** * 执行POST请求。 * * @param url 请求地址 * @param params 参数集合,值允许String和String[]类型 * @param headers 要发送的请求头信息 * @return 响应对象 */ public IHttpResponse post( String url, Map params, Map headers ); /** * 执行POST请求。 * * @param url 请求地址 * @param mediaType 要发送的数据类型 * @param mediaData 要发送的数据 * @param headers 要发送的请求头信息 * @return 响应对象 */ public IHttpResponse post( String url, HttpMediaType mediaType, String mediaData, Map headers ); /** * 执行DELETE请求。 * * @param url 请求地址 * @param params 参数集合,值允许String和String[]类型 * @param headers 要发送的请求头信息 * @return 响应对象 */ public IHttpResponse delete( String url, Map params, Map headers ); /** * 执行DELETE请求。 * * @param url 请求地址 * @param mediaType 要发送的数据类型 * @param mediaData 要发送的数据 * @param headers 要发送的请求头信息 * @return 响应对象 */ public IHttpResponse delete( String url, HttpMediaType mediaType, String mediaData, Map headers ); } // end class




© 2015 - 2025 Weber Informatics LLC | Privacy Policy