3

I'm currently using guzzle for my api requests however the URL is always being encoded. While I understand that this is normal the api I'm using doesn't work with special characters encoded.

For example:

★ StatTrak™ Karambit | Case Hardened (Minimal Wear)

is being encoded to - which causes the api to not work.

%E2__%20StatTrak%E2_%A2%20Karambit%20%7C%20Case%20Hardened%20(Minimal%20Wear)

please note that these are not being send as query strings.

The route for example is api.test.com/price/★ StatTrak™ Karambit | Case Hardened (Minimal Wear)

Here is my code:

$client = new \GuzzleHttp\Client([
    'base_uri' => 'http://api.csgo.steamlytics.xyz/v1/'
]);
$request = new Request('GET', 'prices/'.$desc->market_hash_name.'?key=xxxx');
$response = $client->send($request);
Ricky Barnett
  • 1,130
  • 3
  • 15
  • 32

0 Answers0