You need to sign in to do that
Don't have an account?
Bujji v
HTTP Post request comming to URL
Hi,
I have a doubt I am getting HTTP post request from campaign monitor to my salesfroce URL in the form of JSON.
I got this message in my debug log
Accept-Encoding=gzip, deflate, Cache-Control=no-cache, no-store, max-age=259200, Connection=keep-alive, Content-Length=201, Content-Type=application/json
when i used ApexPages.currentPage().getHeaders();
Now I need to retrive the JSON data, anyone please help me...
Thanks in advance.
Hi Srikanth,
See the links below, should answer your questions,
Problems Parsing JSON Responses with Apex
http://blog.jeffdouglas.com/2009/12/28/problems-parsing-json-responses-with-apex/
http://wiki.developerforce.com/page/Getting_Started_with_Apex_JSON
Sample: Parsing a JSON String and Deserializing It into Objects
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_json_jsonparser.htm
Related discussion:
http://salesforce.stackexchange.com/questions/10635/system-jsonexception-with-object-specific-recent-items
Main release doc:
http://developer.force.com/releases/release/Winter12/JSON+Support+in+Apex
Regards,
Ashish
Actually I am not getting the data in the URL, I am getting the data in some encoded format as I mentioned like gzip, deflate format,, Now I want to read that data from that format...How can I do this?
Thanks,,
Hi Srikanth,
You might have to use:
Also see the blog,
http://www.jesselorenz.com/2008/09/visualforce-determine-salesforcecom.html
Regards,
Ashish
Hi,
I dont want Host URL.. actually Campaign Monitor is sending data to my salesforce site url in the Form of HTTP Post request in the format of JSON.
I want to retrive that data, When i was using ApexPages.currentPage().getHeaders()
I am getting Accept-Encoding=gzip, deflate, Cache-Control=no-cache, no-store, max-age=259200, Connection=keep-alive, Content-Length=197, Content-Type=application/json, Host=.... in my debug log.
I want to retrive that JSON data ..
Hi Srikanth,
Use the tool http://fiddler2.com/ and call the method, you can click on JSON and get the required response.
You have to call the method, and in debugger, click on inspectors Tab and click JSON.
Regards,
Ashish
Hi Srikanth,
See the Fiddler sample Image below,
http://tinypic.com/r/8yrera/5
Regards,
Ashish
Hi Srikanth,
See the Screenshot of JSON captured in Fiddler
http://tinypic.com/r/2ih9qtd/5
Regards,
Ashish