Hi Jerome, We are trying to create a restlet webservice client to call webservice. I like to add some custom headers with my request. But I am confused how to get request object. My code goes like :
private static String empXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<employees>\n" + " <employee fname='Jatin' lname='Gupta' doj='04-07-2009'>\n" + " </employee>\n" + "</employees>"; public void post() throws Exception{ Form form = new Form(); form.add("data", this.empXML); Representation rep = form.getWebRepresentation(); Client client = new Client(Protocol.HTTP); Response response = client.post("http://localhost:8085/restlet/rest", rep); System.out.println("Status of post request"+response.getStatus()); System.out.println(response.getEntity().getText()); } Thanks Jatin -- View this message in context: http://n2.nabble.com/Setting-custom-HTTP-headers-and-ATOM-feeds-tp3287425p3685685.html Sent from the Restlet Discuss mailing list archive at Nabble.com. ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2397486