Special characters appearing in an outbound HTTP POST request.

Special characters appearing in an outbound HTTP POST request.

book

Article ID: KB0092921

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Resolution:
Issue: When sending the following payload in an HTTP POST request:

BE code:
            String post  = "{\"script\" : \"ctx._source.alertHandlerConfig[1].actionHandler.isEnabled=false\"}";    
            Events.Outbound.ESRequest evt1 = Events.Outbound.ESRequest.ESRequest(null,post,"application/json","ascii","UTF-8");

Output: On the server side we see that postdata contains special characters. 
                <PostData>¬í<?tibco-char 0?>
                                <?tibco-char 5?>
                                t<?tibco-char 0?>
                                N{"script" :
"ctx._source.alertHandlerConfig[1].actionHandler.isEnabled=false"}</PostData>


Resolution: This is expected behavior. For events that have no payload schema , we do not describe how the content of the message is built. If the BE engine is placed on the receiver side, it should be able to understand the data. Adding the proper schema to the BaseEvent (Events.Outbound.ESRequest) will provide the expected result and Event.createEvent can be used to build the contents of the Event.

Issue/Introduction

Special characters appearing in an outbound HTTP POST request.