Package one.nio.http
Class HttpClient
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,Cloneable,Iterable<Socket>,Collection<Socket>,Deque<Socket>,List<Socket>,Queue<Socket>,SequencedCollection<Socket>,SocketPoolMXBean
- See Also:
-
Field Summary
FieldsFields inherited from class one.nio.pool.SocketPool
connectTimeout, host, port, proxy, readTimeout, sslContext, tosFields inherited from class one.nio.pool.Pool
closed, createdCount, fifo, initialCount, keepEmpty, maxCount, timeout, timeouts, waitingThreadsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionHttpClient(ConnectionString conn) HttpClient(ConnectionString conn, String... permanentHeaders) -
Method Summary
Modifier and TypeMethodDescriptioncreateRequest(int method, String uri, String... headers) protected voidMethods inherited from class one.nio.pool.SocketPool
createObject, destroyObject, getBusyCount, getConnectTimeout, getFifo, getIdleCount, getMaxCount, getProxy, getReadTimeout, getSslContext, getTimeout, getTimeouts, getWaitingThreads, name, setConnectTimeout, setFifo, setMaxCount, setProxy, setReadTimeout, setSslContext, setTimeoutMethods inherited from class one.nio.pool.Pool
borrowObject, close, initialize, invalidateAll, invalidateObject, isClosed, returnObjectMethods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, reversed, set, size, spliterator, toArray, toArrayMethods inherited from class java.util.AbstractSequentialList
iteratorMethods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subListMethods inherited from interface one.nio.pool.SocketPoolMXBean
invalidateAll, isClosed
-
Field Details
-
permanentHeaders
-
bufferSize
protected int bufferSize
-
-
Constructor Details
-
HttpClient
-
HttpClient
-
-
Method Details
-
setProperties
- Overrides:
setPropertiesin classSocketPool
-
invoke
public Response invoke(Request request) throws InterruptedException, PoolException, IOException, HttpException -
invoke
public Response invoke(Request request, int timeout) throws InterruptedException, PoolException, IOException, HttpException -
get
public Response get(String uri, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
delete
public Response delete(String uri, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
post
public Response post(String uri, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
post
public Response post(String uri, byte[] body, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
put
public Response put(String uri, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
put
public Response put(String uri, byte[] body, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
patch
public Response patch(String uri, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
patch
public Response patch(String uri, byte[] body, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
head
public Response head(String uri, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
options
public Response options(String uri, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
trace
public Response trace(String uri, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
connect
public Response connect(String uri, String... headers) throws InterruptedException, PoolException, IOException, HttpException -
createRequest
-