Jump to content

prototype.js + POST ajax.request


DrDankWD

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.