[PHP] Any idea why this might have broken?

Discussion in 'Programming' started by ItsErikR, Jun 15, 2015.

  1. So, i had this code last night working perfectly for over 4 months.

    PHP:
    $json = @file_get_contents('https://api.mojang.com/profiles/page/1', false, $context);
    Now it doesn't work, it returns "" and i have no idea why. Someone please help.
     
  2. All of the Setting of the request context is completely fine as, again, it used to work.
     
  3. Remove the error suppression and enable php warnings in your script to see what's wrong first. Try to cURL the page as well and see what it returns from there.
     
  4. They blocked get requests
     
  5. @1Rogue helped me fix it. Please close this thread.
     
  6. they havent blocked get requests.. my api extends mojang api and is used a lot with get requests.
     
  7. Why would an API block GET requests...
     
  8. Not going to lie but here
    Capture.PNG
     
  9. The way you worded it, I thought you were saying the whole API blocked GET requests. In this case, you have to add parameters in order to specify your query.