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) ;
  
Regards,
Rajesh
Received on Tuesday, 16 September 1997 10:25:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:26 GMT