Methods defined by MimeHeader, HttpResponse classes in Java: parse, toString, put, get, fix

MimeHeader class: MIME stands for Multipurpose Internet Mail Extensions. It is used to extend the regular email format to support multimedia. In Java it is used for passing attributes between HTTP client and servers. MimeHeader class is a sub class of Hashtable class.

Methods defined by MimeHeader class:

parse( ) method: It takes a string formatted as a MIME header and then enters key and value pairs to an instance of MimeHeader class.



toString( ) method: It takes a key and value pair of an instance of MimeHeader class and returns a string formatted as a MIME header. It is a reverse method of parse( ) method.


String toString( )

put( ) method: It is used to put an entry in calling hash table. The previous values will be overwritten.


Object put(Object k, Object val)

get( ) method: It is used to return value of a key.


Object get(Object k)

fix( ) method: It is used to override put and get methods.


HttpResponse class: It is used to encapsulate replies from an HTTP server. It is used for handling proxy of httpd class. For a request sent to HTTP server its response is an integer status code integer status code. This status code is stored in statusCode, and a textual version is stored in reasonPhrase.

Methods defined by HttpResponse class:

parse( ) method: It is used for parsing request data read from HTTP server.



toString( ) method: It is a reverse method for parse( ) method.


String toString()

Leave a Reply