CQ.HTTP.post() | Community
Skip to main content
Level 4
October 16, 2015
Solved

CQ.HTTP.post()

  • October 16, 2015
  • 4 replies
  • 2051 views

Hi masters!

Do you have any reference, example, tutorial... about using CQ.HTTP.post() to get server data from the browser? I would like to use it to call to /bin/querybuilder. I've done it using JQuery ajax() method, but I suspect that CQ.HTTP.post() will be more 'elegant' solution...

I've checked the official documentation [1], but there's no example...

Thank you very much!

Regards,

Julio.

[1] http://dev.day.com/docs/en/cq/current/widgets-api/?class=CQ.HTTP

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

CQ.HTTP.post is just another way to do the same thing as AJAX. You can post data using AJAX and i would not say that it's less elegant. AJAX is a standard web technology.  

We have examples of using AJAX to post data from a CQ page to a CQ sling servlet.

You can also post data to CQ using Sling Post Servlets.  

However - having said that -- CQ.HTTP.post is part of CQ and there should be an example of how to use it. I will work with the doc team to make this happen. 

4 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

CQ.HTTP.post is just another way to do the same thing as AJAX. You can post data using AJAX and i would not say that it's less elegant. AJAX is a standard web technology.  

We have examples of using AJAX to post data from a CQ page to a CQ sling servlet.

You can also post data to CQ using Sling Post Servlets.  

However - having said that -- CQ.HTTP.post is part of CQ and there should be an example of how to use it. I will work with the doc team to make this happen. 

Level 4
October 16, 2015

Thank you smacdonald2008!

I agree on almost everything you say, but I would like to compare myself both of them. And it's a good opportunity to learn one more thing! smiley

I'll be waiting, and searching, for any update on this documentation.

Best regards!

smacdonald2008
Level 10
October 16, 2015

We added this to our list to base a CQ dev community article on. Once done - I will update this thread with the link to the community article. 

Level 4
October 16, 2015

Thank you very much! I'll be waiting for news!

Best regards,

J.