HTTP 414 URL too long
-
Hi – thanks for a great plugin which does just what I need it to!
However, when I submit the form, unfortunately I get an HTTP 414 error saying the URL is too long.
This isn’t your fault; it’s because SagePay’s system works by sending the whole encryption string through GET. In my own implementation, I put the following which effectively converted the GET string to a POST one which could then be sent through to SagePay without the 414 error:
<form method="POST" id="SagePayForm" action="https://live.sagepay.com/gateway/service/vspform-register.vsp" target="sagepay"> <input type="hidden" name="VPSProtocol" value="3.00"> <input type="hidden" name="TxType" value="PAYMENT"> <input type="hidden" name="Vendor" value="merchantnamehere"> <input type="hidden" name="Crypt" value="' . $sagePay->getCrypt() . '"> </form> <script type="text/javascript"> // Submit the above form automatically to load into the iframe below, or show the // "Go to SagePay" button instead if the screen is too small jQuery( document ).ready( function( $ ) { if ( $(document).width() < 600 ) { $( "#open-full-window" ).show(); } else { $( "#open-full-window" ).hide(); $( "#SagePayForm" ).submit(); } $( document ).on( "click", "#open-full-window", function() { $( "#SagePayForm" ).attr( "target", "_self" ).submit(); }); }); </script>
Is there any chance you’d be able to enhance your plugin to allow it to send via POST instead of GET, using this or some other method?
I’ll leave it with you anyway. Thanks for your great work! ??
Tim
- The topic ‘HTTP 414 URL too long’ is closed to new replies.