gnu.inet.http

Class HTTPURLConnection


public class HTTPURLConnection
extends HttpURLConnection

A URLConnection that uses the HTTPConnection class.

Constructor Summary

HTTPURLConnection(URL url)
Constructor.

Method Summary

void
addRequestProperty(String key, String value)
void
connect()
void
disconnect()
String
getContentType()
InputStream
getErrorStream()
String
getHeaderField(String name)
String
getHeaderField(int index)
long
getHeaderFieldDate(String name, long def)
String
getHeaderFieldKey(int index)
Map
getHeaderFields()
InputStream
getInputStream()
OutputStream
getOutputStream()
Map
getRequestProperties()
String
getRequestProperty(String key)
int
getResponseCode()
String
getResponseMessage()
void
setRequestMethod(String method)
Overrides the corresponding method in HttpURLConnection to permit arbitrary methods, as long as they're valid ASCII alphabetic characters.
void
setRequestProperty(String key, String value)
boolean
usingProxy()

Constructor Details

HTTPURLConnection

public HTTPURLConnection(URL url)
Constructor.
Parameters:
url - the URL

Method Details

addRequestProperty

public void addRequestProperty(String key,
                               String value)

connect

public void connect()
            throws IOException

disconnect

public void disconnect()

getContentType

public String getContentType()

getErrorStream

public InputStream getErrorStream()

getHeaderField

public String getHeaderField(String name)

getHeaderField

public String getHeaderField(int index)

getHeaderFieldDate

public long getHeaderFieldDate(String name,
                               long def)

getHeaderFieldKey

public String getHeaderFieldKey(int index)

getHeaderFields

public Map getHeaderFields()

getInputStream

public InputStream getInputStream()
            throws IOException

getOutputStream

public OutputStream getOutputStream()
            throws IOException

getRequestProperties

public Map getRequestProperties()

getRequestProperty

public String getRequestProperty(String key)

getResponseCode

public int getResponseCode()
            throws IOException

getResponseMessage

public String getResponseMessage()
            throws IOException

setRequestMethod

public void setRequestMethod(String method)
            throws ProtocolException
Overrides the corresponding method in HttpURLConnection to permit arbitrary methods, as long as they're valid ASCII alphabetic characters. This is to permit WebDAV and other HTTP extensions to function.
Parameters:
method - the method

setRequestProperty

public void setRequestProperty(String key,
                               String value)

usingProxy

public boolean usingProxy()