Laravel Http Client return null

I need help in Laravel calling external API. I have two websites: Website A and Website B. Before installing SSL in Website A (http://website A): In Website A controller, I use $response=Http::get('http://website B/api/ec23faa399beda') and it returns value and everything runs well.

After installing SSL in Website A (https://website A):
using the same code $response=Http::get('http://website B/api/ec23faa399beda') and returns Null Value.

I added below code for check whether the HTTP client works or not :

if ($response->ok()) {
  $users = $response->json();
  dd($users);
} else {
  dd('Could not get response');
}

and it show ‘could not get response’. But if i direct hit ‘http://website B/api/ec23faa399beda’ in a browser, it returns value.

Is it because of the SSL I installed on website A, or what? Maybe someone in this forum can help me.

  • are you testing in the local environment ?

    – 

  • nope, i testing on prod env

    – 

  • 3

    try to print $response->body() what you get ,you might get idea

    – 

  • it says “SQLSTATE[42S02]: Base table or view not found” . But why in local environment, it works. Only on production gives this error.

    – 

  • 3

    i cant help much on that unless debuging .just check all tables are created in database

    – 

Leave a Comment