How do I send a POST request with PHP?

前端 未结 13 1550
暗喜
暗喜 2020-11-21 05:40

Actually I want to read the contents that come after the search query, when it is done. The problem is that the URL only accepts POST methods, and it does not t

13条回答
  •  后悔当初
    2020-11-21 05:53

    Try PEAR's HTTP_Request2 package to easily send POST requests. Alternatively, you can use PHP's curl functions or use a PHP stream context.

    HTTP_Request2 also makes it possible to mock out the server, so you can unit-test your code easily

提交回复
热议问题