How do I make an external http call to a function within a custom module?
Thanks,
John
To do that, the function must be declared as a MENU_CALLBACK. This create a path on Drupal router system that you can use to call the function using a HTTP request.
Att,
Pablo Lacerda de Miranda Engenheiro de Software Ci&T - Campinas pablolmiranda@gmail.com +55 11 8701-1086
On Sat, 2010-10-09 at 16:54 -0400, John Mitchell wrote:
How do I make an external http call to a function within a custom module?
Thanks,
John
-- John J. Mitchell
Do you want to do a pragmatic HTTP request and get back the result in order to process it ? If yes, you can use drupal_http_request().
If not, be more precise about what you want to do please.
Pierre.
I want to send an http call to a java servlet which will do some additional processing for order fulfillment and once complete it will return the name of the file which it just created.
John
On 10/9/10, Pierre Rineau pierre.rineau@makina-corpus.com wrote:
On Sat, 2010-10-09 at 16:54 -0400, John Mitchell wrote:
How do I make an external http call to a function within a custom module?
Thanks,
John
-- John J. Mitchell
Do you want to do a pragmatic HTTP request and get back the result in order to process it ? If yes, you can use drupal_http_request().
If not, be more precise about what you want to do please.
Pierre.
Ignore
"I want to send an http call to a java servlet which will do some additional processing for order fulfillment and once complete it will return the name of the file which it just created."
Like I said originally "How do I make an external http call to a function within a custom module?"
To further clarify "How do I make an (external to Drupal) http call to a function within a drupal custom module?"
John
On 10/9/10, John Mitchell mitchelljj98@gmail.com wrote:
I want to send an http call to a java servlet which will do some additional processing for order fulfillment and once complete it will return the name of the file which it just created.
John
On 10/9/10, Pierre Rineau pierre.rineau@makina-corpus.com wrote:
On Sat, 2010-10-09 at 16:54 -0400, John Mitchell wrote:
How do I make an external http call to a function within a custom module?
Thanks,
John
-- John J. Mitchell
Do you want to do a pragmatic HTTP request and get back the result in order to process it ? If yes, you can use drupal_http_request().
If not, be more precise about what you want to do please.
Pierre.
-- John J. Mitchell
On Sat, 2010-10-09 at 19:41 -0400, John Mitchell wrote:
Ignore
"I want to send an http call to a java servlet which will do some additional processing for order fulfillment and once complete it will return the name of the file which it just created."
Like I said originally "How do I make an external http call to a function within a custom module?"
To further clarify "How do I make an (external to Drupal) http call to a function within a drupal custom module?"
John
Hum, I can't ignore what you said, it seems that you want to do an external webservice call in some PHP function code. For this, depending on the webservice you want to contact, you should look in two different directions:
1 - Is there an existing PHP API/library somewhere to talk with this particular webservice? If yes, and you like it, then use it.
2 - If not, then forge your request, and send it using something like the drupal_http_request() function. If you don't like it, you can use file_get_contents() which can do HTTP requests, or curl, or any other third party library which is able to do it.
Hope this will help you.
Pierre.