vendredi 27 mars 2020

Log ERRORs html form post to external url

My API brings the client to my domain, this API request contains a parameter called return_url, where after process is complete on my domain we will post on client's return_url along with response parameter.

To do this, redirect to return_url, I have code as following:

<form action="http://client-return-url.com" method="post" name='returnform'>
    <input type="hidden" name="request_id">
    <input type="hidden" name="status">
</form>
<script>
    window.onload = function(){
      document.forms['returnform'].submit();
    }
</script>

This works fine.

Is there a way I can save a log if there is error, for example the return url is incorrect URL that doesn't exist, or there is a 500 error due to some code issue on return_url.

Again, return_url is not in my control, the moment I do a form post control is away from me, but I want to inform my clients of any error when I do form post on their return_url.

Thanks,

K



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire