Welcome Guest, Not a member yet? Register   Sign In
curl->simple_get json
#1

I have proble using curl simple_get
when trying to get json, it always return bool(false)
when I tried the api address in browser, they works just fine


Code:
  public function test_curl()
  {

$response = (object)null;

$data = json_decode($this->curl->simple_get('any_json_api_address'));
   
    if (!empty($data))
    {
      $response->isSuccess = TRUE;
      $response->message = 'success.';
      $response->data = $data;
    }
    else
    {
      $response->isSuccess = FALSE;
      $response->message = 'failed.';
    }

    echo json_encode($response);
  }
Reply


Messages In This Thread
curl->simple_get json - by momokaze - 12-07-2022, 01:06 AM
RE: curl->simple_get json - by InsiteFX - 12-09-2022, 12:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB