Petras
Petras

Reputation: 4759

What is the equivalent of ASP.NET's WebRequest in php?

What is the equivalent of ASP.NET's WebRequest in php?

Upvotes: 1

Views: 7089

Answers (3)

JAL
JAL

Reputation: 21563

I think that would be fopen, which can retrieve data from files or remote URLs.

You could also look into using curl if you're interested in retrieving remote resources.

Upvotes: 6

gnrfan
gnrfan

Reputation: 19381

Just to add that the file() function can work with URLs too:

http://www.php.net/manual/en/function.file.php

A URL can be used as a filename with this function if the fopen wrappers have been enabled.

HTTP, HTTPS are both soported but using these functions you're generating only GET request.

I'd also go curl for the whole package.

Upvotes: 2

Rubens Farias
Rubens Farias

Reputation: 57946

You can to use curl.

Some samples here: Make Yahoo! Web Service REST Calls with PHP

Upvotes: 3

Related Questions