PHP Difference between Curl and HttpRequest

前端 未结 3 1459
半阙折子戏
半阙折子戏 2020-12-10 10:34

I have a need to do RAW POST (PUT a $var) requests to a server, and accept the results from that page as a string. Also need to add custom HTTP header information (like x-ex

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 11:20

    HTTPRequest (and the PECL extension) is built on libcurl.

    http://us.php.net/manual/en/http.requirements.php

    The HTTPRequest is really just an easier/more syntactically friendly way to perform the same task.

    As Frank Farmer mentioned, you're more likely to have a target platform with curl already installed and could have difficulty getting the PECL library installed by the hosting provider.

提交回复
热议问题