Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
com.griddynamics.jagger.invoker.v2.JHttpQuery< T > Class Reference

An object that represents HTTP-request. More...

Inheritance diagram for com.griddynamics.jagger.invoker.v2.JHttpQuery< T >:

Public Member Functions

JHttpQuery< T > body (T body)
 Sets parameter body to JHttpQuery#body field. More...
 
JHttpQuery< T > cookie (String name, String value)
 Adds Cookie header "name=value" to JHttpQuery#headers field. More...
 
JHttpQuery< T > cookies (Map< String, String > cookies)
 Adds cookies to JHttpQuery#headers field. More...
 
JHttpQuery< T > delete ()
 Sets JHttpQuery#method to HttpMethod#DELETE. More...
 
boolean equals (Object o)
 
JHttpQuery< T > get ()
 Sets JHttpQuery#method to HttpMethod#GET. More...
 
getBody ()
 
HttpHeaders getHeaders ()
 
HttpMethod getMethod ()
 
String getPath ()
 
Map< String, String > getQueryParams ()
 
Class getResponseBodyType ()
 
int hashCode ()
 
JHttpQuery< T > head ()
 Sets JHttpQuery#method to HttpMethod#HEAD. More...
 
JHttpQuery< T > header (String key, List< String > values)
 Adds header "key=values" to JHttpQuery#headers. More...
 
JHttpQuery< T > header (String key, String value)
 Adds header "key=value" to JHttpQuery#headers. More...
 
JHttpQuery< T > headers (HttpHeaders headers)
 Sets parameter headers to JHttpQuery#headers field. More...
 
JHttpQuery< T > headers (Map< String, List< String >> headers)
 Sets parameter headers to JHttpQuery#headers field. More...
 
JHttpQuery< T > method (HttpMethod method)
 Sets parameter method to JHttpQuery#method field. More...
 
JHttpQuery< T > options ()
 Sets JHttpQuery#method to HttpMethod#OPTIONS. More...
 
JHttpQuery< T > patch ()
 Sets JHttpQuery#method to HttpMethod#PATCH. More...
 
JHttpQuery< T > path (String path)
 Sets path to JHttpQuery#path field. More...
 
JHttpQuery< T > path (String...paths)
 Concatenates paths values and sets to JHttpQuery#path field. More...
 
JHttpQuery< T > path (String formatString, Object...args)
 Sets path of query to JHttpQuery#path field. More...
 
JHttpQuery< T > post ()
 Sets JHttpQuery#method to HttpMethod#POST. More...
 
JHttpQuery< T > put ()
 Sets JHttpQuery#method to HttpMethod#PUT. More...
 
JHttpQuery< T > queryParam (String paramName, String paramValue)
 Adds query parameter "paramName=paramValue" to JHttpQuery#queryParams field. More...
 
JHttpQuery< T > queryParams (Map< String, String > queryParams)
 Sets parameter queryParams to JHttpQuery#queryParams field. More...
 
JHttpQuery< T > responseBodyType (Class responseBodyType)
 Sets parameter responseBodyType to JHttpQuery#responseBodyType field. More...
 
String toString ()
 
JHttpQuery< T > trace ()
 Sets JHttpQuery#method to HttpMethod#TRACE. More...
 

Static Public Member Functions

static JHttpQuery copyOf (JHttpQuery jHttpQuery)
 

Static Public Attributes

static final JHttpQuery EMPTY_QUERY = null
 

Detailed Description

An object that represents HTTP-request.

It consists of JHttpQuery#method, JHttpQuery#headers, JHttpQuery#body and JHttpQuery#queryParams fields.

It contains methods which makes query construction concise and easy to read.

Parameters
<T>type of the query JHttpQuery#body
Author
Anton Antonenko Example of query construction:
HashMap<String, String> cookies = new HashMap<>();
cookies.put("JSESSIONID", "0123456789");
HttpHeaders headers = new HttpHeaders();
headers.add("header", "value");
JHttpQuery<Integer> httpQuery = new JHttpQuery<Integer>()
.get()
.cookies(cookies)
.cookie("name", "value")
.headers(headers)
.header("header", newArrayList("value1", "value2"))
.queryParam("query param", "value")
.clientParam("client param", new Object())
.body(42);
Since
2.0

Definition at line 46 of file JHttpQuery.java.


The documentation for this class was generated from the following file: