tags:

views:

84

answers:

2

I've a web page on which certain section is being populated by ajax. I want this data. I've written a java program which posts the data and submit the form but unable to fetch the ajax content of the response.

My application is a core java app.

I'm simply posting data/submitting form with all request parameters set correctly. But not getting the data in response which is populated by ajax. :-(

How can i get that data? Any suggestions?

A: 

Standard ajax requests have an additional HTTP X-Requested-With header. If they are filtering requests by type you will get nothing.

Accept  application/json, text/javascript, */*
...
X-Requested-With    XMLHttpRequest

As people commented try it on Firefox with Firebug addon and check the request headers.

knoopx
A: 

Also, if you are trying to use AJAX to get data from different domain, you are going to fail miserably. You would need to create a proxy for that.

Vladimir Kocjancic