All Packages Class Hierarchy This Package Previous Next Index
Class Acme.PostURLConnection
java.lang.Object
|
+----Acme.PostURLConnection
- public class PostURLConnection
- extends Object
A URLConnection that implements POST.
Some implementations of URLConnection, e.g. the one in Navigator 3.0,
do not support POST. This is a stripped-down version that does.
Note that it can't inherit from java.net.URLConnection because that
class has no public constructors. Not all the standard URLConnection
methods are re-implemented here, just the ones necessary for posting.
This class is not needed in current browsers.
Fetch the software.
Fetch the entire Acme package.
-
PostURLConnection(URL)
- Constructs a POST URL connection to the specified URL.
-
close()
-
-
connect()
-
-
getContentLength()
-
-
getContentType()
- Gets the content type.
-
getDoInput()
-
-
getDoOutput()
-
-
getHeaderField(String)
- Gets a header field by name.
-
getHeaderFieldDate(String, long)
- Gets a header field by name.
-
getHeaderFieldInt(String, int)
- Gets a header field by name.
-
getInputStream()
- Call this routine to get an InputStream that reads from the object.
-
getOutputStream()
- Call this routine to get an OutputStream that writes to the object.
-
getRequestProperty(String)
-
-
getURL()
- Gets the URL for this connection.
-
getUseCaches()
-
-
setDoInput(boolean)
- A URL connection can be used for input and/or output.
-
setDoOutput(boolean)
- A URL connection can be used for input and/or output.
-
setRequestProperty(String, String)
-
-
setUseCaches(boolean)
- Some protocols do caching of documents.
-
toString()
- Returns the String representation of the URL connection.
PostURLConnection
public PostURLConnection(URL url)
- Constructs a POST URL connection to the specified URL.
- Parameters:
- url - the specified URL
connect
public void connect() throws IOException
close
public void close() throws IOException
getURL
public URL getURL()
- Gets the URL for this connection.
getContentLength
public int getContentLength() throws IOException
getContentType
public String getContentType() throws IOException
- Gets the content type. Returns null if not known.
getHeaderField
public String getHeaderField(String name) throws IOException
- Gets a header field by name. Returns null if not known.
- Parameters:
- name - the name of the header field
getHeaderFieldInt
public int getHeaderFieldInt(String name,
int def) throws IOException
- Gets a header field by name. Returns null if not known.
The field is parsed as an integer.
- Parameters:
- name - the name of the header field
- def - the value to return if the field is missing or malformed.
getHeaderFieldDate
public long getHeaderFieldDate(String name,
long def) throws IOException
- Gets a header field by name. Returns null if not known.
The field is parsed as a date.
- Parameters:
- name - the name of the header field
- def - the value to return if the field is missing or malformed.
getInputStream
public InputStream getInputStream() throws IOException
- Call this routine to get an InputStream that reads from the object.
- Throws: UnknownServiceException
- If the protocol does not support input.
getOutputStream
public OutputStream getOutputStream() throws IOException
- Call this routine to get an OutputStream that writes to the object.
- Throws: UnknownServiceException
- If the protocol does not support output.
toString
public String toString()
- Returns the String representation of the URL connection.
- Overrides:
- toString in class Object
setDoInput
public void setDoInput(boolean doInput)
- A URL connection can be used for input and/or output. Set the DoInput
flag to true if you intend to use the URL connection for input,
false if not. The default for PostURLConnections is false.
getDoInput
public boolean getDoInput()
setDoOutput
public void setDoOutput(boolean doOutput)
- A URL connection can be used for input and/or output. Set the DoOutput
flag to true if you intend to use the URL connection for output,
false if not. The default for PostURLConnections is true.
getDoOutput
public boolean getDoOutput()
setUseCaches
public void setUseCaches(boolean useCaches)
- Some protocols do caching of documents. Occasionally, it is important
to be able to "tunnel through" and ignore the caches (e.g. the "reload"
button in a browser). If the UseCaches flag on a connection is true,
the connection is allowed to use whatever caches it can. If false,
caches are to be ignored. The default for PostURLConnections is false.
getUseCaches
public boolean getUseCaches()
setRequestProperty
public void setRequestProperty(String name,
String value)
getRequestProperty
public String getRequestProperty(String name)
All Packages Class Hierarchy This Package Previous Next Index
ACME Java ACME Labs