W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1997

Trying to use Jigsaw classes in a Client

From: Rajesh Chawla <rajesh@herndon.xes.xerox.com>
Date: Tue, 16 Sep 1997 07:24:34 PDT
Message-Id: <199709161424.KAA00466@orion.herndon>
To: www-jigsaw@w3.org
Hi folks,

I'm trying to use the Jigsaw HTTP classes in a 
client to implement the IPP protocol that uses HTTP 1.1 
as a transport layer.

What I want to do is to send a request with these parameters:

	method:		 Post
	Mimetype: 	 application/ipp
	URL:  		 /ipp/testing
	Data in Request: "Testing from Rajesh"

Is the following code the correct way to do this, or am 
I missing stuff?
  HttpManager     manager = HttpManager.getManager() ;

  Request request = manager.createRequest() ;
  request.setContentType (new MimeType ("application", "ipp"));
  request.setMethod ("POST");
  request.setURL(new URL("http://orion:2000/ipp/testing"));

  String dataToSend;
  dataToSend = new String("Testing from Rajesh");
  ByteArrayInputStream inByte;
  inByte = new ByteArrayInputStream (dataToSend.getBytes());
  request.setOutputStream (inByte);
  Reply    reply = manager.runRequest(request) ;
Received on Tuesday, 16 September 1997 10:25:09 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:31 UTC