Package org.javalite.http
Class Multipart
Sets up a Multipart request to send multiple text fields as well as upload files.
- Author:
- Igor Polevoy on 5/1/16.
-
Field Summary
Fields inherited from class org.javalite.http.Request
connection, redirect, url -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MultipartMakes a connection to the remote resource.Convenience method to add a form field to the request.Adds a form field to the requestConvenience method to add multiple fields to the request.Convenience method to add a file fields to the request.static voidMethods inherited from class org.javalite.http.Request
basic, basic, bytes, connect, dispose, getInputStream, header, headers, redirect, responseCode, responseMessage, text, text
-
Constructor Details
-
Multipart
Constructor to make multipart requests- Parameters:
url- URL to send request toconnectTimeout- connection timeoutreadTimeout- read timeout
-
-
Method Details
-
doConnect
Description copied from class:RequestMakes a connection to the remote resource. -
field
Adds a form field to the request- Parameters:
field- instance of form field- Returns:
- self
-
field
Convenience method to add a form field to the request.- Parameters:
name- name of fieldvalue- value of field- Returns:
- self
-
fields
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
Convenience method to add a file fields to the request.- Parameters:
fieldName- name of fieldfilePath- fully qualified path to a file.- Returns:
- self.
-
main
-