示例代码如下所示:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("Inside Post");
Client client =Client.create();
WebResource webResource=client.resource("https://mondelezinternational-test.coupahost.com/api/invoices/");
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
ClientResponse resp=webResource.queryParams(queryParams).header("X-COUPA-API-KEY","53fb46e5bb0dbe7fc338f22e2d5035e52cc302fa").header("Accept","application/xml").post(ClientResponse.class);
System.out.println("Responce Body"+resp.getStatusInfo());
System.out.println("Responce Body"+resp.getStatus());
System.out.println("Responce Body"+resp.getLanguage());
System.out.println("Responce Body"+resp.getHeaders());
if (resp.getStatus()==200)