Class PostWriter
java.lang.Object
org.apache.jmeter.protocol.http.sampler.PostWriter
- Direct Known Subclasses:
PutWriter
Class for setting the necessary headers for a POST request, and sending the
body of the POST.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for PostWriter.PostWriter(String boundary) Constructor for PostWriter -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGet the boundary string, used to separate multipartssendPostData(URLConnection connection, HTTPSamplerBase sampler) Send POST data from Entry to the open connection.voidsetHeaders(URLConnection connection, HTTPSamplerBase sampler)
-
Field Details
-
BOUNDARY
The boundary string between multiparts- See Also:
-
ENCODING
-
formDataUrlEncoded
protected byte[] formDataUrlEncodedThe form data that is going to be sent as url encoded -
formDataPostBody
protected byte[] formDataPostBodyThe form data that is going to be sent in post body
-
-
Constructor Details
-
PostWriter
public PostWriter()Constructor for PostWriter. Uses the PostWriter.BOUNDARY as the boundary string -
PostWriter
Constructor for PostWriter- Parameters:
boundary- the boundary string to use as marker between multipart parts
-
-
Method Details
-
sendPostData
Send POST data from Entry to the open connection.- Parameters:
connection- the open connection to use for sending datasampler- sampler to get information about what to send- Returns:
- the post body sent. Actual file content is not returned, it is just shown as a placeholder text "actual file content"
- Throws:
IOException- when writing data fails
-
setHeaders
- Throws:
IOException
-
getBoundary
Get the boundary string, used to separate multiparts- Returns:
- the boundary string
-