Class PostWriter
- java.lang.Object
-
- org.apache.jmeter.protocol.http.sampler.PostWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
BOUNDARY
The boundary string between multipartsstatic String
ENCODING
protected byte[]
formDataPostBody
The form data that is going to be sent in post bodyprotected byte[]
formDataUrlEncoded
The form data that is going to be sent as url encoded
-
Constructor Summary
Constructors Constructor Description PostWriter()
Constructor for PostWriter.PostWriter(String boundary)
Constructor for PostWriter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getBoundary()
Get the boundary string, used to separate multipartsString
sendPostData(URLConnection connection, HTTPSamplerBase sampler)
Send POST data from Entry to the open connection.void
setHeaders(URLConnection connection, HTTPSamplerBase sampler)
-
-
-
Field Detail
-
BOUNDARY
protected static final String BOUNDARY
The boundary string between multiparts- See Also:
- Constant Field Values
-
ENCODING
public static final String ENCODING
- See Also:
- Constant Field Values
-
formDataUrlEncoded
protected byte[] formDataUrlEncoded
The form data that is going to be sent as url encoded
-
formDataPostBody
protected byte[] formDataPostBody
The form data that is going to be sent in post body
-
-
Constructor Detail
-
PostWriter
public PostWriter()
Constructor for PostWriter. Uses the PostWriter.BOUNDARY as the boundary string
-
PostWriter
public PostWriter(String boundary)
Constructor for PostWriter- Parameters:
boundary
- the boundary string to use as marker between multipart parts
-
-
Method Detail
-
sendPostData
public String sendPostData(URLConnection connection, HTTPSamplerBase sampler) throws IOException
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
public void setHeaders(URLConnection connection, HTTPSamplerBase sampler) throws IOException
- Throws:
IOException
-
getBoundary
protected String getBoundary()
Get the boundary string, used to separate multiparts- Returns:
- the boundary string
-
-