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()
String
getHeaderField(int index)
String
getHeaderField(String name)
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()


getHeaderField

public String getHeaderField(int index)


getHeaderField

public String getHeaderField(String name)


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()


* HTTPURLConnection.java * Copyright (C) 2004 The Free Software Foundation * * This file is part of GNU inetlib, a library. * * GNU inetlib is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * GNU inetlib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Linking this library statically or dynamically with other modules is * making a combined work based on this library. Thus, the terms and * conditions of the GNU General Public License cover the whole * combination. * * As a special exception, the copyright holders of this library give you * permission to link this library with independent modules to produce an * executable, regardless of the license terms of these independent * modules, and to copy and distribute the resulting executable under * terms of your choice, provided that you also meet, for each linked * independent module, the terms and conditions of the license of that * module. An independent module is a module which is not derived from * or based on this library. If you modify this library, you may extend * this exception to your version of the library, but you are not * obliged to do so. If you do not wish to do so, delete this * exception statement from your version.