我想使用Rest API在java程序中创建/修改工作项。 我的服务器是Apache-coyote / 1.1。
HttpClient client = new DefaultHttpClient();
JSONObject JSONobj = new JSONObject();
System.out.println("hello ");
HttpPost post = new HttpPost("https://");
post.setHeader("Content-Type", "application/json ");
post.setHeader("xyz","abcd"); //userid and password
StringEntity input = new StringEntity(JSONobj.toString());
System.out.println("hello ");
post.setEntity(input);
System.out.println("hello ");
HttpResponse response = client.execute(post);