0

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.

5
  • are you testing in the local environment ? Commented Jan 11, 2024 at 3:45
  • nope, i testing on prod env Commented Jan 11, 2024 at 3:46
  • 3
    try to print $response->body() what you get ,you might get idea Commented Jan 11, 2024 at 3:48
  • it says "SQLSTATE[42S02]: Base table or view not found" . But why in local environment, it works. Only on production gives this error. Commented Jan 11, 2024 at 3:55
  • 3
    i cant help much on that unless debuging .just check all tables are created in database Commented Jan 11, 2024 at 3:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.