How to make Post Request from Controller in Laravel?
Hello all,
I have 2 server, I want when I upload image to server 1 (S1), this image will be upload to server 2 (S2). So i think i need make a POST request from Controller on S1.
For upload image to another server: i have tried some way as curl, guzzle with no success.
@bobbybouwmann i have tried and it still not work with error in log:
[2016-02-02 15:18:20] s3.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method GuzzleHttp\Psr7\Response::addPostFile()' in ...
@Mithridates Because i buy this script, and it use javascript for handling post request from view to controller, after that this javascript response to view data return from controller. My JS is bad :(
@mr66 maybe I don't figure out your situation totally, but this approach seems to me really nasty.
The over all time of response time of your app will dramatically drain with this approach I think.
Along with some possible security issues.
I can see it's been a while with this thread, but I agree with @Mithridates
You would be better off, throwing the image onto a amazon s3 and having the other server checking for updates on s3 bucket and pulling down the new images.