Package org.jsoup
Interface Connection.KeyVal
-
- All Known Implementing Classes:
HttpConnection.KeyVal
- Enclosing interface:
- Connection
public static interface Connection.KeyValA Key:Value tuple(+), used for form data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringcontentType()Get the current Content Type, ornullif not set.Connection.KeyValcontentType(java.lang.String contentType)Set the Content Type header used in the MIME body (aka mimetype) when uploading files.booleanhasInputStream()Does this keyval have an input stream?java.io.InputStreaminputStream()Get the input stream associated with this keyval, if anyConnection.KeyValinputStream(java.io.InputStream inputStream)Add or update an input stream to this keyValjava.lang.Stringkey()Get the key of a keyvalConnection.KeyValkey(java.lang.String key)Update the key of a keyvaljava.lang.Stringvalue()Get the value of a keyvalConnection.KeyValvalue(java.lang.String value)Update the value of a keyval
-
-
-
Method Detail
-
key
Connection.KeyVal key(java.lang.String key)
Update the key of a keyval- Parameters:
key- new key- Returns:
- this KeyVal, for chaining
-
key
java.lang.String key()
Get the key of a keyval- Returns:
- the key
-
value
Connection.KeyVal value(java.lang.String value)
Update the value of a keyval- Parameters:
value- the new value- Returns:
- this KeyVal, for chaining
-
value
java.lang.String value()
Get the value of a keyval- Returns:
- the value
-
inputStream
Connection.KeyVal inputStream(java.io.InputStream inputStream)
Add or update an input stream to this keyVal- Parameters:
inputStream- new input stream- Returns:
- this KeyVal, for chaining
-
inputStream
@Nullable java.io.InputStream inputStream()
Get the input stream associated with this keyval, if any- Returns:
- input stream if set, or null
-
hasInputStream
boolean hasInputStream()
Does this keyval have an input stream?- Returns:
- true if this keyval does indeed have an input stream
-
contentType
Connection.KeyVal contentType(java.lang.String contentType)
Set the Content Type header used in the MIME body (aka mimetype) when uploading files. Only useful ifinputStream(InputStream)is set.Will default to
application/octet-stream.- Parameters:
contentType- the new content type- Returns:
- this KeyVal
-
contentType
@Nullable java.lang.String contentType()
Get the current Content Type, ornullif not set.- Returns:
- the current Content Type.
-
-