Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.889.760 Times

HTTPClient 0.3-3

  Date Added: July 08, 2010  |  Visits: 663

HTTPClient

Report Broken Link
Printer Friendly Version


Product Homepage
Download (74 downloads)



This package provides a complete http client library. It currently implements most of the relevant parts of the HTTP/1.0 and HTTP/1.1 protocols, including the request methods HEAD, GET, POST and PUT, and automatic handling of authorization, redirection requests, and cookies. Furthermore the included Codecs class contains coders and decoders for the base64, quoted-printable, URL-encoding, chunked and the multipart/form-data encodings. The whole thing is free, and licenced under the GNU Lesser General Public License (LGPL) (note that this is not the same as the GPL). Following are the kits and documentation for the HTTPClient Version 0.3-3. If you have any problems, bugs, suggestions, comments, etc. see the info on debugging and reporting problems. An older version of these pages are also available in Japanese, thanks to the kindly efforts of Yuji Kumasaka. Using the HTTPClient should be quite simple. First add the import statement import HTTPClient.*; to your file(s). Next you create an instance of HTTPConnection (youll need one for every server you wish to talk to). Requests can then be sent using one of the methods Head(), Get(), Post(), etc in HTTPConnection. These methods all return an instance of HTTPResponse which has methods for accessing the response headers (getHeader(), getHeaderAsInt(), etc), various response info (getStatusCode(), getReasonLine(), etc), the response data (getData(), getText(), and getInputStream()) and any trailers that might have been sent (getTrailer(), getTrailerAsInt(), etc). Following are some examples to get started. To retrieve files from the URL "http://www.myaddr.net/my/file" you can use something like the following: try { HTTPConnection con = new HTTPConnection("www.myaddr.net"); HTTPResponse rsp = con.Get("/my/file"); if (rsp.getStatusCode() >= 300) { System.err.println("Received Error: "+rsp.getReasonLine()); System.err.println(rsp.getText()); } else data = rsp.getData(); rsp = con.Get("/another_file"); if (rsp.getStatusCode() >= 300) { System.err.println("Received Error: "+rsp.getReasonLine()); System.err.println(rsp.getText()); } else other_data = rsp.getData(); } catch (IOException ioe) { System.err.println(ioe.toString()); } catch (ParseException pe) { System.err.println("Error parsing Content-Type: " + pe.toString()); } catch (ModuleException me) { System.err.println("Error handling request: " + me.getMessage()); } This will get the files "/my/file" and "/another_file" and put their contents into byte[]s accessible via getData(). Note that you need to only create a new HTTPConnection when sending a request to a new server (different protocol, host or port); although you may create a new HTTPConnection for every request to the same server this not recommended, as various information about the server is cached after the first request (to optimize subsequent requests) and persistent connections are used whenever possible (see also Advanced Info). To POST form data from an applet back to your server you could use something like this (assuming you have two fields called name and e-mail, whose contents are stored in the variables name and email): try { NVPair form_data[] = new NVPair[2]; form_data[0] = new NVPair("name", name); form_data[1] = new NVPair("e-mail", email); // note the convenience constructor for applets HTTPConnection con = new HTTPConnection(this); HTTPResponse rsp = con.Post("/cgi-bin/my_script", form_data); if (rsp.getStatusCode() >= 300) { System.err.println("Received Error: "+rsp.getReasonLine()); System.err.println(rsp.getText()); } else stream = rsp.getInputStream(); } catch (IOException ioe) { System.err.println(ioe.toString()); } catch (ModuleException me) { System.err.println("Error handling request: " + me.getMessage()); } Here the response data is read at leisure via an InputStream instead of all at once into a byte[]. As another example, if you want to upload a document to a URL (and the server supports http PUT) you could do something like the following: try { URL url = new URL("http://www.mydomain.us/test/my_file"); HTTPConnection con = new HTTPConnection(url); HTTPResponse rsp = con.Put(url.getFile(), "Hello World"); if (rsp.getStatusCode() >= 300) { System.err.println("Received Error: "+rsp.getReasonLine()); System.err.println(rsp.getText()); } else text = rsp.getText(); } catch (IOException ioe) { System.err.println(ioe.toString()); } catch (ModuleException me) { System.err.println("Error handling request: " + me.getMessage()); }.

Requirements: No special requirements
Platforms: Linux
Keyword: Catch Complete Http Data Form Http Http Client Httpclient Httpconnection Httpresponse New Nvpair Received Error Server Url
Users rating: 0/10

License: Freeware Size: 532.48 KB
USER REVIEWS
More Reviews or Write Review


HTTPCLIENT RELATED
Networking Tools  -  PPTP Client 1.7.1
PPTP Client allows you to connect to a PPTP server from a Linux box. It sets up a PPTP connection, after which the PPP daemon establishes a PPP link over that PPTP call. So youd like to run a PPTP tunnel from your Linux, FreeBSD, NetBSD or...
58.37 KB  
Libraries  -  HTTP::DAV 0.31
HTTP::DAV is a WebDAV client library for Perl5. SYNOPSIS # DAV script that connects to a webserver, safely makes # a new directory and uploads all html files in # the /tmp directory. use HTTP::DAV; $d = new HTTP::DAV; $url =...
76.8 KB  
Libraries  -  HTTP::Handle 0.2
HTTP::Handle is a HTTP Class designed for streaming. SYNOPSIS use HTTP::Handle; my $http = HTTP::Handle->new( uri => "http://www.google.com/" ); $http->connect(); my $fd = $http->fd(); while ( ) { print "--> $_"; } The...
5.12 KB  
Modules  -  HTTP authentication 1.0
Features - Accept - but not force - HTTP authentication on the whole website. - For anonymous users, force HTTP authentication when an Access denied page is shown on configured pages. (This will not work if you use a custom access denied page.) -...
 
Security Tools  -  SimpleHTTPDB 1.0
SimpleHTTPDB is a client based key-value database that allows for storing data on any http-server via FTP. This way, no server-based functionality is required. Security of the data is provided by high-level encryption.
166.19 KB  
Network Monitors  -  HTTP Sniffer and Analyzer 1.2
If you need a handily tool to capture and analyze all communications over the HTTP protocol then xIBL HTTP Sniffer and Analyzer is a program for you. HTTP transactions can be examined to see the HTTP header values, cookies, query strings and error...
266 KB  
Science  -  GDL - GNU Data Language 0.9.2
GDL - GNU Data Language, a free IDL (Interactive Data Language, see http://ittvis.com/idl/) compatible incremental compiler.
2.32 MB  
Libraries  -  Scrape::USPS::ZipLookup Perl Module 2.4
The United States Postal Service (USPS) has on its web site an HTML form at http://www.usps.com/zip4/ for standardizing an address. Given a firm, urbanization, street address, city, state, and zip, it will put the address into standard form...
11.26 KB  
Weather  -  Alien News Free 2.8.0.0
Alien News Free is an unofficial licensed client for Reddit (http://www.reddit.com/) V2.3 - bug fixes in new functionality V2.2 now supports reddit messaging! V1.4 includes clickable links in comment text. V1.5 includes...
1024 KB  
Travel  -  Decouvrir44 1.0.0.0
Decouvrir la Loire Atlantique vous propose une liste des lieux incontournables ? visiter. Ces donnees se basent sur le flux open data :...
1024 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, NETWORK & INTERNET
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Linux Software  -  SLAX 6.0+
Slax is a modern, portable, small and fast Linux operating system with a modular approach and outstanding design. Despite its small size, Slax provides a wide collection of pre-installed software for daily use, including a well organized graphical...
190 KB  
Linux Software  -  GTK+ 2.5
GTK+, which stands for the GIMP Toolkit, is a library for creating graphical user interfaces for the X Window System. It is designed to be small, efficient, and flexible. GTK+ is written in C with a very object-oriented approach. Language bindings...
60 MB  
Network & Internet  -  Free WiFi Hotspot 3.3.1
Free WiFi Hotspot is a super easy solution to turn your laptop or notebook into a portable Wi-Fi hotspot, wirelessly sharing your internet connections like DSL, Cable, Bluetooth, Mobile Broadband Card, Dial-Up, etc. through the built-in wireless...
1.04 MB  
Network & Internet  -  Easy Uploads 1.8
Easy uploads is a file storage media streaming application designed by Filestreamers that allows you to upload, store, and stream your files from their virtually unlimited file storage server. Easy Uploads can backup,share, and stream your files...
615.97 KB  
Network & Internet  -  IPv6 CARE 3.2b
IPv6 CARE, "IPv6 Compliant Automatic Runtime Environment", is a Linux tool able to patch ipv6-agnostic programs on-the-fly ('patch' mode). It can also generate a diagnosis about the IPv6 compliance of an application ('check' mode).
409.6 KB  
Network & Internet  -  PacketFence ZEN 3.1.0
PacketFence is a fully supported, trusted, Free and Open Source network access control (NAC) system. Boosting an impressive feature set including a captive-portal for registration and remediation, centralized wired and wireless management, 802.1X...
1024 MB  
Network & Internet  -  django-dbstorage 1.3
A Django file storage backend for files in the database.
10.24 KB