0

i get a encoded string when saving a string When i save:

'FFFA

i get:

'FFFA

how can i save them using the ff curl request:

curl "https://api.adbutler.com/v1/banners/custom-html" \
-H "Authorization: Basic {API_KEY}" \
-H "Content-Type: application/json" \
-X POST \
-d '{  
      "custom_html": "",
      "expand_horizontal_direction": "left",
      "expand_vertical_direction": "down",
      "height": 250,
      "html_content_below": "Hello 'world",
      "location": "http://www.google.ca",
      "name": "Demo Custom HTML' Banner",
      "tracking_pixel": "url",
      "width": 300
    }'
Viscocent
  • 2,024
  • 2
  • 19
  • 26

2 Answers2

0

set another curl option for CURLOPT_ENCODING and set it to "" to ensure it will not return any garbage

     $location = 'https://api.adbutler.com/v1/banners/custom-html';
$ch = curl_init($location);
       curl_setopt($ch, CURLOPT_ENCODING ,"");
Bilal Ahmed
  • 4,005
  • 3
  • 22
  • 42
0

You can try this

curl "https://api.adbutler.com/v1/banners/custom-html" \
-H "Authorization: Basic {API_KEY}" \
-H "Content-Type: application/json" \
-X POST \
-d '{  
  "custom_html": "",
  "expand_horizontal_direction": "left",
  "expand_vertical_direction": "down",
  "height": 250,
  "html_content_below": "Hello '\''world",
  "location": "http://www.google.ca",
  "name": "Demo Custom HTML'\'' Banner",
  "tracking_pixel": "url",
  "width": 300
}'

see this link for more info

Yu Jiaao
  • 4,444
  • 5
  • 44
  • 57