public class MultipartUtility extends Object
Constructor and Description |
---|
MultipartUtility(String requestURL,
String jwt,
String charset)
This constructor initializes a new HTTP POST request with content type
is set to multipart/form-data
|
Modifier and Type | Method and Description |
---|---|
void |
addFilePart(String fieldName,
File uploadFile)
Adds a upload file section to the request
|
void |
addFormField(String name,
String value)
Adds a form field to the request
|
void |
addHeaderField(String name,
String value)
Adds a header field to the request.
|
String |
finish()
Completes the request and receives response from the server.
|
public MultipartUtility(String requestURL, String jwt, String charset) throws IOException
requestURL
- charset
- IOException
public void addFormField(String name, String value)
name
- field namevalue
- field valuepublic void addFilePart(String fieldName, File uploadFile) throws IOException
fieldName
- name attribute in uploadFile
- a File to be uploadedIOException
public void addHeaderField(String name, String value)
name
- - name of the header fieldvalue
- - value of the header fieldpublic String finish() throws IOException
IOException
Copyright © 2007-2021 Universidade Federal do ParanĂ¡ - UFPR. All Rights Reserved.