We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How to send http request to url | Forum

vivek
vivek Apr 24 '14
Hi, i  am working on oxwall plugin. I am stuck at one problem .
I need to know how to send http request to url.
For example :
1) In joomla CMS we send request like this
$http = new JHttp($options, $transport);
$response = $http->post($url, $data);


2)In drupal ,
$options = array(
    'method' => 'POST',
    'data' => $data,
    'timeout' => 15,
    'headers' => array('Content-Type' => 'application/json'),
  );
$result = drupal_http_request($url, $option);


I want to know , what is the oxwall way  of doing this task, Please help me or hint me which library  to look out.

vivek
vivek Apr 25 '14
any 1 ?
Sean
Sean Apr 25 '14
OW::getRouter()->urlForRoute('routename',array('var'=>value));


Is that what you mean? That would allow you to pass variables to other pages on your site, you'd need to make sure the route was formatted correctly though, for example:


('routewithvar','/varroute/:var','ROUTEWITHVAR_CTRL_Action','index')

The Forum post is edited by Sean Apr 25 '14
vivek
vivek Apr 25 '14
Hi, my url is not same website , it sends post request to www.api.somewebsite.com ;
vivek
vivek May 1 '14
Any help from developer team ?
Alia Team
Alia May 6 '14
Vivek, we are planning to add structured interface for sending requests in one of the upcoming builds. Until then you can use only standard PHP libraries and functions:  file_get_contents or cURL.
vivek
vivek May 7 '14

Quote from Aliia Vivek, we are planning to add structured interface for sending requests in one of the upcoming builds. Until then you can use only standard PHP libraries and functions:  file_get_contents or cURL.

Thank you for clearing.
And please make detailed file structure page of libraries/methods in documentation. It would be very helpful for developers. :)