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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.