Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can decode the Unicode chars in shell by surrounding your CURL command with, echo -en "$(curl URL)"

 

Example;

Curl command not surrounded with echo -en "$“$()”

curl --silent --header "Accept: application/json" -u admin:password http://localhost:8085/objects/TEST/SUBSCRIPTION/.*/SELECTOR)"

 

Curl command not surrounded with echo -en “$()”

...

Code Block
$ curl --silent --header "Accept: application/json" -u admin:

...

password http://localhost:8085/objects/TEST/SUBSCRIPTION/.*/SELECTOR

...


{

...


  "queryTime": 0,

...


  "objects": [

...


    {

...


      "messageBrokerName": "TEST",

...


      "objectName": "TestSub",

...


      "objectType": "SUBSCRIPTION",

...


      "entryTime": "28/05/2018 11:07:57 AM",

...


      "fields": {

...


        "SELECTOR": "EAI_method \u003d \u0027notifyStatusChange\u0027 AND EAI_mandant \u003d \u0027000\u0027 AND EAI_routingCode LIKE \u0027%O%\u0027"

...


      }

...


    }

...


  ]

...


}

...

Same curl command surrounded with echo -en “$()”

$ echo -en "$(curl curl --silent --header "Accept: application/json" -u admin:password http://localhost:8085/objects/TEST/SUBSCRIPTION/.*/SELECTOR)"

 

Code Block
languagexml
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1206  100  1206    0     0   157k      0 --:--:-- --:--:-- --:--:--  196k$ echo -en "$(curl --silent --header "Accept: application/json" -u admin:password http://localhost:8085/objects/TEST/SUBSCRIPTION/.*/SELECTOR)"
{
  "queryTime": 0,
  "objects": [
    {
      "messageBrokerName": "TEST",
      "objectName": "TestSub",
      "objectType": "SUBSCRIPTION",
      "entryTime": "28/05/2018 11:06:27 AM",
      "fields": {
        "SELECTOR": "EAI_method = 'notifyStatusChange' AND EAI_mandant = '000' AND EAI_routingCode LIKE '%O%'"
      }
    }
  ]
}