Can I make a POST request in RGraph.AJAX?


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Goldy on 6th May 2013
I am using RGraph.AJAX(url,loadCallBack) for dynamically loading Line Graph.
By default its doing a Get request.
What if I want to do a Post request and submit all the form data along with the URL.
How do I do that?
I have mapping in the web.xml file to my servlet Get and Post requests both.
But the "url" in the RGraph.AJAX(url,loadCallBacK), whats the url here that I should give
I am not sure if its the right question to ask , so pleas help me
Posted by RGraph support on 6th May 2013
Hi there,

The RGraph AJAX function only handles GET requests - so if you wish to use POST you will need to use your own AJAX function - or jQuery can probably handle it.



Richard, RGraph Support
Posted by RGraph support on 6th May 2013
Hi there,

OK disregard that - as of the next beta there'll be a new function available for making AJAX POST requests in RGraph:

RGraph.AJAX.POST('/foo.php', {'var1':67856757, 'var2':'56757456'}, myCallback)



Richard, RGraph Support
Posted by Goldy on 6th May 2013
can I use that POST function now ?
Apart from that, can I send form values along with this call.
I am making a POST call to my servlet that fetches me values to plot on Graph.
But along with the POST call I want to send form values to the servlet too.
Is it possible ?
Posted by RGraph support on 7th May 2013
Hi there,

You can't use it until it's been released - and it's not even in the beta yet. And yes you could send form data with the function. Eg:


myValue = document.getElementById('myInput').value;
RGraph.AJAX.POST('/myScript.jsp', {'myValue': myValue}, myCallback);




Richard, RGraph Support
Posted by Goldy on 7th May 2013
Ok, so I have to wait for the next release for using this POST method.
But for now , is there anyway in which I can send form data along with the url call?
Posted by RGraph support on 7th May 2013
Hi there,

Only as GET variables as part of the URL:

/getData.jsp?var1=blah&var2=blah&var3=blah



Richard, RGraph support

Add a reply




« Back to message list