# Class URL.HttpURLConnection

java.lang.Object
com.codename1.io.URL.URLConnection
com.codename1.io.URL.HttpURLConnection

Enclosing class:
  `URL`

public class URL.HttpURLConnection extends URL.URLConnection

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `connect()`
  `int`
  `getContentLength()`
  `String`
  `getContentType()`
  `String`
  `getHeaderField(String s)`
  `Map<String, List<String>>`
  `getHeaderFields()`
  `InputStream`
  `getInputStream()`
  `OutputStream`
  `getOutputStream()`
  `void`
  `setRequestMethod(String method)`

  ### Methods inherited from class URL.URLConnection

  `getConnectTimeout, getContentLengthLong, getDoInput, getDoOutput, getReadTimeout, getURL, setConnectTimeout, setDoInput, setDoOutput, setReadTimeout, setRequestProperty`
  Modifier and Type
  Method
  Description
  `int`
  `getConnectTimeout()`
  `long`
  `getContentLengthLong()`
  `boolean`
  `getDoInput()`
  `boolean`
  `getDoOutput()`
  `int`
  `getReadTimeout()`
  `URL`
  `getURL()`
  `void`
  `setConnectTimeout(int connectTimeout)`
  `void`
  `setDoInput(boolean i)`
  `void`
  `setDoOutput(boolean i)`
  `void`
  `setReadTimeout(int readTimeout)`
  `void`
  `setRequestProperty(String key, String value)`
  Sets the request property, replacing existing property with same key, if it already exists.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `final Class`
  `getClass()`
  Returns the runtime class of an object.
  `int`
  `hashCode()`
  Returns a hash code value for the object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `String`
  `toString()`
  Returns a string representation of the object.
  `final void`
  `wait()`
  Causes current thread to wait until another thread invokes the method or the method for this object.
  `final void`
  `wait(long timeout)`
  Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
  `final void`
  `wait(long timeout, int nanos)`
  Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

- ## Method Details

  - ### connect

    public void connect() throws IOException
    Specified by:
      `connect` in class `URL.URLConnection`
    Throws:
      `IOException`

  - ### setRequestMethod

    public void setRequestMethod(String method)

  - ### getContentLength

    public int getContentLength()
    Specified by:
      `getContentLength` in class `URL.URLConnection`

  - ### getContentType

    public String getContentType()
    Specified by:
      `getContentType` in class `URL.URLConnection`

  - ### getHeaderField

    public String getHeaderField(String s)
    Specified by:
      `getHeaderField` in class `URL.URLConnection`

  - ### getHeaderFields

    public Map<String, List<String>> getHeaderFields()
    Specified by:
      `getHeaderFields` in class `URL.URLConnection`

  - ### getInputStream

    public InputStream getInputStream() throws IOException
    Specified by:
      `getInputStream` in class `URL.URLConnection`
    Throws:
      `IOException`

  - ### getOutputStream

    public OutputStream getOutputStream() throws IOException
    Specified by:
      `getOutputStream` in class `URL.URLConnection`
    Throws:
      `IOException`