create issue from POST request
Can i use POST request to create issue?
when i send POST from Java, have problem with encoding
example:
Task-108 ????????
?????????? ???????? (?????????? - ??? ????)?????????: ???????????
code:
when i send POST from Java, have problem with encoding
example:
Task-108 ????????
?????????? ???????? (?????????? - ??? ????)?????????: ???????????
code:
String desc = description + "\n Автор:"+author;
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("project", "Task"));
nameValuePairs.add(new BasicNameValuePair("summary", subject));
nameValuePairs.add(new BasicNameValuePair("description", desc));
HttpPost httpPost = new HttpPost(yBaseUrl + "/rest/issue");
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpClient client = new DefaultHttpClient();
//response = client.execute(httppost, localContext);
// add request header
((DefaultHttpClient) client).setCookieStore(cookie);
HttpResponse response = null;
//client.execute(post);
try {
response = client.execute(httpPost);
System.out.println(response.getStatusLine().getStatusCode());
} catch (IOException e) {
e.printStackTrace();
}
Please sign in to leave a comment.