IBM QRadar SOAR

 View Only

Call REST API - UnicodeEncodeError

  • 1.  Call REST API - UnicodeEncodeError

    Posted 9 days ago

    Hi, 
    I need your help on the topic of using the REST API function of the PUT method. I need to add a comment/change description in the description to the request. In the situation when I try to pass Polish characters for example: Ł
    I get the message:
    UnicodeEncodeError: 'latin-1' codec can't encode character 'ƒu0142' in position 40: Body ('ł') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.

    I tried the way with encoding and decoding :

    I also added in headers:
    Accept-Language: pl-PL

    Please help me with the topic, seemingly a simple topic, but not really with this function.

    Thanks 
    Łukasz 



    ------------------------------
    Łukasz Tyński
    ------------------------------