Hi there. I'm using JMWE add-on to perform a HTTP POST request on an issue as a post function. Here's my code:
import groovyx.net.http.HTTPBuilder;
import static groovyx.net.http.ContentType.*;
import groovyx.net.http.ContentType;
import static groovyx.net.http.Method.*;
def http = new HTTPBuilder('myhost.com')
http.request( POST ) {
uri.path = '/'
requestContentType = ContentType.JSON
body = [title: issue.get("summary"), desc: issue.get("description")]
log.info(body.title)
response.success = { resp ->
log.info( "POST response status: "+resp.statusLine+"}")
}
}
This is what request looks like from my web service side:In Jira and Groovy test console characters look fine.
How do I fix this?
Hi Gleb,
I don't believe the encoding is wrong - it's just that your console on the web service side cannot print Unicode characters. JSON supports Unicode without any problem, so your request body is correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.