Class HttpUploadClient
- java.lang.Object
-
- org.jboss.netty.example.http.upload.HttpUploadClient
-
public final class HttpUploadClient extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
BASE_URL
(package private) static java.lang.String
FILE
private static java.lang.String
textArea
private static java.lang.String
textAreaLong
-
Constructor Summary
Constructors Constructor Description HttpUploadClient()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>>
formget(ClientBootstrap bootstrap, java.lang.String host, int port, java.lang.String get, java.net.URI uriSimple)
Standard usage of HTTP API in Netty without file Upload (get is not able to achieve File upload due to limitation on request size).private static java.util.List<InterfaceHttpData>
formpost(ClientBootstrap bootstrap, java.lang.String host, int port, java.net.URI uriSimple, java.io.File file, HttpDataFactory factory, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> headers)
Standard post without multipart but already support on Factory (memory management)private static void
formpostmultipart(ClientBootstrap bootstrap, java.lang.String host, int port, java.net.URI uriFile, HttpDataFactory factory, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> headers, java.util.List<InterfaceHttpData> bodylist)
Multipart examplestatic void
main(java.lang.String[] args)
-
-
-
Field Detail
-
BASE_URL
static final java.lang.String BASE_URL
-
FILE
static final java.lang.String FILE
-
textArea
private static final java.lang.String textArea
- See Also:
- Constant Field Values
-
textAreaLong
private static final java.lang.String textAreaLong
- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
formget
private static java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> formget(ClientBootstrap bootstrap, java.lang.String host, int port, java.lang.String get, java.net.URI uriSimple) throws java.lang.Exception
Standard usage of HTTP API in Netty without file Upload (get is not able to achieve File upload due to limitation on request size).- Returns:
- the list of headers that will be used in every example after
- Throws:
java.lang.Exception
-
formpost
private static java.util.List<InterfaceHttpData> formpost(ClientBootstrap bootstrap, java.lang.String host, int port, java.net.URI uriSimple, java.io.File file, HttpDataFactory factory, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> headers) throws java.lang.Exception
Standard post without multipart but already support on Factory (memory management)- Returns:
- the list of HttpData object (attribute and file) to be reused on next post
- Throws:
java.lang.Exception
-
formpostmultipart
private static void formpostmultipart(ClientBootstrap bootstrap, java.lang.String host, int port, java.net.URI uriFile, HttpDataFactory factory, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> headers, java.util.List<InterfaceHttpData> bodylist) throws java.lang.Exception
Multipart example- Throws:
java.lang.Exception
-
-