DrDankWD Posted July 18, 2008 Share Posted July 18, 2008 I am having some trouble with an ajax request using prototype.js. Basically I had a function that save some content to the database, the problem started when the amount of content was exceeding the character limit of GET. So i switched the 'method' to POST. But now I am getting a 406 Not Acceptable error when trying to make the request. Here is the ajax request: function saveEditPage(page_id) { var url = 'ajax/prTreeAjax.php?action=saveEditPage'; var pars = ''; pars += 'page_id=' + page_id; pars += '&title=' + escape(document.getElementById('edit_page_title').value); pars += '&description=' + escape(document.getElementById('edit_description').value); var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: getMessageResponse }); function getMessageResponse(originalRequest) { showPage(page_id); } } Anyone have any ideas as to why I am getting the 406 error when using the POST method? When I use GET it works fine (other than not allow for the large amount of text to be sent). Thanks, DrDankWD Link to comment https://forums.phpfreaks.com/topic/115479-prototypejs-post-ajaxrequest/ Share on other sites More sharing options...
DrDankWD Posted July 18, 2008 Author Share Posted July 18, 2008 Well I have narrowed it down to the server environment. Same code works fien on a cpanel/whm server. The box its currently on is a Plesk server that has been nothing but trouble. Link to comment https://forums.phpfreaks.com/topic/115479-prototypejs-post-ajaxrequest/#findComment-593811 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.