Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How do I make HTTP Request to another website?


Go to End


3 Posts   743 Views

Avatar
dev-91

Community Member, 1 Post

1 July 2015 at 11:25pm

Hi,

I am trying to make a http request to another website inside a controller method. I searched on net but I didn't got any working sample.

Following I what I am trying to achieve (in php code):

$r = new HttpRequest('http://community.bba.org/home', HttpRequest::METH_GET);
$r->addQueryData(array('SessionID' => $arrGetParams['SessionID']));
try {
$r->send();
} catch (HttpException $ex) {
}

But that didn't work. Please guid me how can I accomplish this task?

Thanks

Avatar
Pyromanik

Community Member, 419 Posts

3 July 2015 at 10:38am

Edited: 03/07/2015 10:39am

Avatar
martimiz

Forum Moderator, 1391 Posts

3 July 2015 at 10:48pm

Excuse me? :)