connection, redirect, url
Constructor and Description |
---|
Multipart(String url,
int connectTimeout,
int readTimeout)
Contructor to make multipart requests
|
Modifier and Type | Method and Description |
---|---|
protected Multipart |
doConnect()
Makes a connection to the remote resource.
|
Multipart |
field(FormField field)
Adds a form field to the request
|
Multipart |
field(String name,
String value)
Convenience method to add a form field to the request.
|
Multipart |
fields(String... namesAndValues)
Convenience method to add multiple fields to the request.
|
Multipart |
file(String fieldName,
String filePath)
Convenience method to add a file fields to the request.
|
static void |
main(String[] args) |
basic, bytes, connect, dispose, getInputStream, header, headers, redirect, responseCode, responseMessage, text, text
public Multipart(String url, int connectTimeout, int readTimeout)
url
- URL to send request toconnectTimeout
- connection timeoutreadTimeout
- read timeoutprotected Multipart doConnect()
Request
public Multipart field(FormField field)
field
- instance of form fieldpublic Multipart field(String name, String value)
name
- name of fieldvalue
- value of fieldpublic Multipart fields(String... namesAndValues)
namesAndValues
- names/values of multiple fields to be added to the request.public Multipart file(String fieldName, String filePath)
fieldName
- name of fieldfilePath
- fully qualified path to a file.public static void main(String[] args)
Copyright © 2016 JavaLite. All rights reserved.