public class TargetRequest extends Object
Constructor and Description |
---|
TargetRequest(TargetConfiguration targetConfiguration,
String method,
URL url,
boolean hasEntityBody) |
TargetRequest(TargetConfiguration targetConfiguration,
URL url,
String method,
boolean hasEntityBody)
Create a target request.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
String value) |
void |
connect(Pipe pipe) |
String |
getMethod() |
org.apache.http.HttpRequest |
getRequest() |
boolean |
hasEntityBody() |
void |
setChunk(boolean chunk) |
void |
setFullUrl(boolean fullUrl) |
void |
setKeepAlive(boolean keepAlive) |
void |
setPort(int port) |
void |
setVersion(org.apache.http.ProtocolVersion version) |
void |
start(org.apache.http.nio.NHttpClientConnection conn) |
int |
write(org.apache.http.nio.NHttpClientConnection conn,
org.apache.http.nio.ContentEncoder encoder)
Consume the data from the pipe and write it to the wire.
|
public TargetRequest(TargetConfiguration targetConfiguration, URL url, String method, boolean hasEntityBody)
targetConfiguration
- the configuration of the senderurl
- the url to be usedmethod
- the HTTP methodhasEntityBody
- weather request has an entity bodypublic TargetRequest(TargetConfiguration targetConfiguration, String method, URL url, boolean hasEntityBody)
public void connect(Pipe pipe)
public void start(org.apache.http.nio.NHttpClientConnection conn) throws IOException, org.apache.http.HttpException
IOException
org.apache.http.HttpException
public int write(org.apache.http.nio.NHttpClientConnection conn, org.apache.http.nio.ContentEncoder encoder) throws IOException
conn
- the connection to the targetencoder
- encoder for writing the message throughIOException
- if an error occurspublic boolean hasEntityBody()
public String getMethod()
public void setChunk(boolean chunk)
public void setPort(int port)
public void setFullUrl(boolean fullUrl)
public void setVersion(org.apache.http.ProtocolVersion version)
public void setKeepAlive(boolean keepAlive)
public org.apache.http.HttpRequest getRequest()
Copyright © 2005-2017 Apache Software Foundation. All Rights Reserved.