Skip to main content
2 of 2
deleted 11 characters in body
rene
  • 2.8k
  • 2
  • 17
  • 35

StackExchange API's request data is blank in Drupal 7

I'm trying to implement this simple request in Drupal 7 on my local machine:

$request = drupal_http_request('https://api.stackexchange.com/2.2/users?order=desc&sort=reputation&site=stackoverflow');
$json_response = drupal_json_decode($request->data);

For your information:

From my side, the endpoint seems to work fine, as it sends a correct JSON result with all the users.

But I still can't recover the data because it's like $request->data appears like blank despite the "4468 characters". That's wierd.

enter image description here

While I'm supposed to get something like that, with a very beautiful JSON string:

enter image description here

If I try with another API, like Twitter for example, it works fine (sorry I put an old depreciated endpoint but it's not important, I get the data back anyway) :

enter image description here

Does someone have a clue about that strange issue?