Forum Discussion

asmabel's avatar
asmabel
New Contributor
15 years ago

How to set encoding UTF-8 in request post ?

Hello everybody,
I have problem with send parameter in UTF-8 encoding. When I use browser every thing is correct. When I use SOPA UI, servlet is not able recognize characters in UTF-8.
The only thing what I do in HTTP Test Request is setting encoding property to UTF-8.
Maybe I should do something more. 
My POST request in SOAP UI looks like:


POST http://localhost:8080/WebTest/Test?text ... 4%85%C4%85 HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: text/xml

User-Agent: Jakarta Commons-HttpClient/3.1

Host: localhost:8080

Content-Length: 0




Do you have any idea ?
Thanks for help

6 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    You can manually add the Content-Type header and it will override the generated one. Go into the "Headers" tab for the request and add a new header. Name it "Content-Type" (without the quotes) and set the value to "text/xml; charset=utf-8" (again, no quotes). Good luck!

    Regards,
    Dain
    eviware.com
    • feckhar's avatar
      feckhar
      Occasional Contributor

      Thank you for this help, setting the header in the request.  If the response is coming back in IBM037, how do I set this header?

      • nmrao's avatar
        nmrao
        Champion Level 3

        Question does not seem to be clear. Can you elaborate what you mean?

    • bdupont's avatar
      bdupont
      New Contributor

      Hello, quoting:

      You can manually add the Content-Type header and it will override the generated one. Go into the "Headers" tab for the request and add a new header. Name it "Content-Type" (without the quotes) and set the value to "text/xml; charset=utf-8" (again, no quotes). Good luck!

       

      -> That's fine for one test, but what if you want to do this for all your requests by default  ?

       

      I guess I can do that with groovy scripts, but is there an integrated way?