Is it possible to use $this->_redirect() in a controller to call an external url and post data to it the same way an HTML form does in Magento 2.2?

If yes, how?

If no, any suggested alternatives on how to achieve this?

1 Answer 1


Actually you can redirect to external url using ->setRedirect('https://google.com'); exit;.

Another way you could do is using _redirectUrl($url);.

I do not know abou posting data with POST request, but you can do it easily with GET request.

In the alterntive I'd suggest to use cURL to post whichever way you want.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.