samedi 22 avril 2023

sending photos as url by POST method in Laravel 5

I have two projects, A and B. In Project A, I send JSON data along with photo URLs (e.g. http://localhost:8000/images/jWjHlWLwCUz72NAz.jpg) to Project B via a POST method to a specific route (e.g. http://localhost:8002/upload).

I have tried the following:

Sending data without photos from Project A to Project B, which works. Sending data with photos using Postman to Project B, which also works. However, when I try to send JSON data with photo URLs from Project A, I receive the following error after a long time: "ErrorException: file_get_contents(http://localhost:8000/images/jWjHlWLwCUz72NAz.jpg): failed to open stream: HTTP request failed!"

When I try to send the same JSON data using Postman, everything works as expected, and the photos are saved on the disk.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire