dw.net
Class HTTPRequestPart

This represents a part in a multi-part HTTP POST request.
A part always has a name and value. The value may be a String, Bytes, or the contents of a File.
A character encoding may be specified for any of these, and the content type and a file name may additionally be specified for the Bytes and File types.
Note: when this class is used with sensitive data, be careful in persisting sensitive information.
Properties
bytesValue
:
Bytes
(Read Only)
Get the Bytes value of the part.
contentType
:
String
(Read Only)
The content type of this part.
encoding
:
String
(Read Only)
Get the charset to be used to encode the string.
fileName
:
String
(Read Only)
Get the file name to use when sending a file part.
fileValue
:
File
(Read Only)
Get the file value of the part.
name
:
String
(Read Only)
Get the name of the part.
stringValue
:
String
(Read Only)
Get the string value of the part.
Constructor Summary
HTTPRequestPart(name
:
String, value
:
String)
Construct a part representing a simple string name/value pair.
HTTPRequestPart(name
:
String, value
:
String, encoding
:
String)
Construct a part representing a simple string name/value pair.
HTTPRequestPart(name
:
String, file
:
File)
Construct a part representing a name/File pair.
HTTPRequestPart(name
:
String, data
:
Bytes)
Construct a part representing a name/bytes pair.
HTTPRequestPart(name
:
String, data
:
Bytes, contentType
:
String, encoding
:
String, fileName
:
String)
Construct a part representing a name/File pair.
HTTPRequestPart(name
:
String, file
:
File, contentType
:
String, encoding
:
String)
Construct a part representing a name/File pair.
Method Summary
getBytesValue()
:
Bytes
Get the Bytes value of the part.
getContentType()
:
String
Returns the content type of this part.
getEncoding()
:
String
Get the charset to be used to encode the string.
getFileName()
:
String
Get the file name to use when sending a file part.
getFileValue()
:
File
Get the file value of the part.
getStringValue()
:
String
Get the string value of the part.
Methods inherited from class
Object
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
Salesforce Commerce Cloud Courses
Salesforce B2C Commerce Developer - Certification Tests
Why risk failing the SFCC exam? Get 180 real questions, killer content, and everything you need to crush the Salesforce B2C Commerce Developer certification.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Becoming a Salesforce B2C Commerce Developer is your ticket to higher salaries, better job opportunities, and the credibility to stand out from the competition. But let's be honestβpassing the certification exam isn't easy. That's where we come in.
Salesforce Javascript Developer I - Certification Tests
Not just another prep courseβthis is your shortcut to passing. Master JavaScript for Salesforce and go from 'hoping to pass' to knowing you will. Ready to start?
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
This isn't just another prep courseβit's your shortcut to mastering the skills and confidence you need to pass. With multiple practice tests covering every section and a final exam simulation designed to mirror the real thing, you'll feel like you've already aced it before test day.
Salesforce B2C Commerce Architect - Certification Tests
Think the Developer exam was hard? Welcome to the next level.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
The Salesforce B2C Commerce Architect certification is a whole different gameβcomplex solutions, elevated difficulty, and skills that set you apart in the eCommerce industry. That's why we're including 11 downloadable PDF guides, packed with best practices and strategies to help you prepare for the exam and build confidence in every topic.
Constructor Detail
HTTPRequestPart
Construct a part representing a simple string name/value pair. The HTTP
message uses "US-ASCII" as the default character set for the part.
Parameters:
name
-
The name of the part.
value
-
The string to post.
HTTPRequestPart
Construct a part representing a simple string name/value pair. The HTTP
message uses the specified encoding or "US-ASCII" if null is passed
for the part.
Parameters:
name
-
The name of the part.
value
-
The string to post.
encoding
-
The charset to be used to encode the string, if null the default is used.
HTTPRequestPart
Construct a part representing a name/File pair. The HTTP message will use
"application/octet-stream" as the content type and "ISO-8859-1" as the character
set for the part.
Parameters:
name
-
The name of the file part
file
-
The file to post
HTTPRequestPart
Construct a part representing a name/bytes pair. The HTTP message will use
"application/octet-stream" as the content type without a character set.
Parameters:
name
-
The name of the file part
data
-
The bytes to post
HTTPRequestPart
public HTTPRequestPart(name
:
String, data
:
Bytes, contentType
:
String, encoding
:
String, fileName
:
String)
Construct a part representing a name/File pair.
- If both contentType and encoding are null, then the part will be defaulted to use "application/octet-stream" as the content-type without an encoding.
- If only the encoding is null, then the contentType will be used without an encoding.
- If only the contentType is null, then it will be defaulted to "text/plain".
Parameters:
name
-
The name of the file part
data
-
The bytes to post
contentType
-
The content type for this part, if null or blank the default is used.
encoding
-
the charset encoding for this part, if null or blank the default is used.
fileName
-
The file name to use in the Mime header, or null to not use one.
HTTPRequestPart
Construct a part representing a name/File pair.
- If both contentType and encoding are null, then the part will be defaulted to use "application/octet-stream" as the content-type and "ISO-8859-1" as the encoding.
- If only the encoding is null, then the contentType will be used without an encoding.
- If only the contentType is null, then it will be defaulted to "text/plain".
Parameters:
name
-
The name of the file part
file
-
The file to post
contentType
-
The content type for this part, if null or blank the default is used.
encoding
-
the charset encoding for this part, if null or blank the default is used
HTTPRequestPart
public HTTPRequestPart(name
:
String, file
:
File, contentType
:
String, encoding
:
String, fileName
:
String)
Construct a part representing a name/File pair.
- If both contentType and encoding are null, then the part will be defaulted to use "application/octet-stream" as the content-type and "ISO-8859-1" as the encoding.
- If only the encoding is null, then the contentType will be used without an encoding.
- If only the contentType is null, then it will be defaulted to "text/plain".
Parameters:
name
-
The name of the file part
file
-
The file to post
contentType
-
The content type for this part, if null or blank the default is used.
encoding
-
the charset encoding for this part, if null or blank the default is used
fileName
-
The file name to use in the Mime header, or null to use the name of the given file.
Method Detail
getBytesValue
getBytesValue()
:
Bytes
Get the Bytes value of the part.
Returns:
The Bytes value, or null if this part is not a Bytes part.
getContentType
getContentType()
:
String
Returns the content type of this part.
Returns:
The content type, or null if content type was not specified.
getEncoding
getEncoding()
:
String
Get the charset to be used to encode the string.
Returns:
The charset, or null if charset was not specified.
getFileName
getFileName()
:
String
Get the file name to use when sending a file part.
Returns:
File name to use in the Mime header, or null for default behavior.
getFileValue
getFileValue()
:
File
Get the file value of the part.
Returns:
The file value, or null if this part is not a file part.
getStringValue
getStringValue()
:
String
Get the string value of the part.
Returns:
The string value, or null if this part is not a string part.