Package org.javalite.http
Class Multipart
- java.lang.Object
-
- org.javalite.http.Request<Multipart>
-
- org.javalite.http.Multipart
-
-
Field Summary
-
Fields inherited from class org.javalite.http.Request
connection, redirect, url
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MultipartdoConnect()Makes a connection to the remote resource.Multipartfield(String name, String value)Convenience method to add a form field to the request.Multipartfield(FormField field)Adds a form field to the requestMultipartfields(String... namesAndValues)Convenience method to add multiple fields to the request.Multipartfile(String fieldName, String filePath)Convenience method to add a file fields to the request.static voidmain(String[] args)-
Methods inherited from class org.javalite.http.Request
basic, basic, bytes, connect, dispose, getInputStream, header, headers, redirect, responseCode, responseMessage, text, text
-
-
-
-
Constructor Detail
-
Multipart
public Multipart(String url, int connectTimeout, int readTimeout)
Constructor to make multipart requests- Parameters:
url- URL to send request toconnectTimeout- connection timeoutreadTimeout- read timeout
-
-
Method Detail
-
doConnect
protected Multipart doConnect()
Description copied from class:RequestMakes a connection to the remote resource.
-
field
public Multipart field(FormField field)
Adds a form field to the request- Parameters:
field- instance of form field- Returns:
- self
-
field
public Multipart field(String name, String value)
Convenience method to add a form field to the request.- Parameters:
name- name of fieldvalue- value of field- Returns:
- self
-
fields
public Multipart fields(String... namesAndValues)
Convenience method to add multiple fields to the request. Names and values alternate: name1, value1, name2, value2, etc.- Parameters:
namesAndValues- names/values of multiple fields to be added to the request.- Returns:
- self
-
file
public Multipart file(String fieldName, String filePath)
Convenience method to add a file fields to the request.- Parameters:
fieldName- name of fieldfilePath- fully qualified path to a file.- Returns:
- self.
-
main
public static void main(String[] args)
-
-