• <tfoot id='acWLz'></tfoot>

    <small id='acWLz'></small><noframes id='acWLz'>

  • <i id='acWLz'><tr id='acWLz'><dt id='acWLz'><q id='acWLz'><span id='acWLz'><b id='acWLz'><form id='acWLz'><ins id='acWLz'></ins><ul id='acWLz'></ul><sub id='acWLz'></sub></form><legend id='acWLz'></legend><bdo id='acWLz'><pre id='acWLz'><center id='acWLz'></center></pre></bdo></b><th id='acWLz'></th></span></q></dt></tr></i><div id='acWLz'><tfoot id='acWLz'></tfoot><dl id='acWLz'><fieldset id='acWLz'></fieldset></dl></div>
    • <bdo id='acWLz'></bdo><ul id='acWLz'></ul>
      <legend id='acWLz'><style id='acWLz'><dir id='acWLz'><q id='acWLz'></q></dir></style></legend>

        PHP cURL 如何添加用户代理值或克服服务器阻止 cURL 请求?

        PHP cURL how to add the User Agent value OR overcome the Servers blocking cURL requests?(PHP cURL 如何添加用户代理值或克服服务器阻止 cURL 请求?)
        <legend id='ghKTo'><style id='ghKTo'><dir id='ghKTo'><q id='ghKTo'></q></dir></style></legend>
            <tbody id='ghKTo'></tbody>
        • <small id='ghKTo'></small><noframes id='ghKTo'>

          • <bdo id='ghKTo'></bdo><ul id='ghKTo'></ul>

                <i id='ghKTo'><tr id='ghKTo'><dt id='ghKTo'><q id='ghKTo'><span id='ghKTo'><b id='ghKTo'><form id='ghKTo'><ins id='ghKTo'></ins><ul id='ghKTo'></ul><sub id='ghKTo'></sub></form><legend id='ghKTo'></legend><bdo id='ghKTo'><pre id='ghKTo'><center id='ghKTo'></center></pre></bdo></b><th id='ghKTo'></th></span></q></dt></tr></i><div id='ghKTo'><tfoot id='ghKTo'></tfoot><dl id='ghKTo'><fieldset id='ghKTo'></fieldset></dl></div>

                  <tfoot id='ghKTo'></tfoot>

                  本文介绍了PHP cURL 如何添加用户代理值或克服服务器阻止 cURL 请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在传输一个对象数组.我在自己的服务器上有一个 cURL 客户端(提交者)在其他服务器上的侦听脚本,这是我无法控制的.然后我认为,他们阻止了 传入的 cURL 请求,因为当我使用普通的 HTML <form> 进行测试时,它正在工作.但无论如何都不是通过 cURL.

                  I am transferring an Object Array. I have a cURL client (submitter) on own Server and listening script on other's Server, which one is not under my control. Then i think there, they are blocking the incoming cURL requests because when i test with the normal HTML <form>, it is working. But not via cURL anyway.

                  所以我认为他们对 cURL 做了一些限制.

                  So i think they have done some restriction to cURL.

                  那么我的问题是:

                  1. 服务器能否限制/阻止 cURL 传入请求?
                  2. 如果是这样,我可以在启动 cURL 脚本中欺骗/更改 HTTP 标头(用户代理)吗?
                  3. 或者还有其他可能的故事吗?

                  谢谢!

                  推荐答案

                  1. 在服务器端,我们可以通过识别http请求中的头部字段(包括refer、cookie、user-agent等)、ip地址、访问频率来阻止一些请求.而且在大多数情况下,机器生成的请求通常与人的请求不同,例如,no refer &cookie,或者访问频率更高,我们可以写一些规则来拒绝这些请求.

                  1. In the server side, we can block some requests by recognize the header fields(including refer, cookie, user-agent and so on) in http request, the ip address, access frequency. And in most case, requests generated by machine usually has something different than human requests,for example, no refer & cookie, or with higher access frequency, we can write some rules to deny these requests.

                  根据1,你可以通过填充header字段,使用随机和更慢的频率,使用更多的ip地址,尽量模拟真实的请求.(听起来像是攻击)

                  According to 1, you can try your best to simulate real requests by filling the header fields, using random and slower frequency, using more ip addresses. (sounds like attack)

                  一般情况下,使用较低的频率,不给他们的服务器增加负载,遵循他们的访问规则,他们很少会阻止你的请求.

                  Generally, using lower frequency and do not make heavy load for their server, follow their access rules, they will seldom block your requests.

                  这篇关于PHP cURL 如何添加用户代理值或克服服务器阻止 cURL 请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <small id='BOubY'></small><noframes id='BOubY'>

                  <legend id='BOubY'><style id='BOubY'><dir id='BOubY'><q id='BOubY'></q></dir></style></legend>
                    <bdo id='BOubY'></bdo><ul id='BOubY'></ul>

                    1. <tfoot id='BOubY'></tfoot>
                          <tbody id='BOubY'></tbody>
                        • <i id='BOubY'><tr id='BOubY'><dt id='BOubY'><q id='BOubY'><span id='BOubY'><b id='BOubY'><form id='BOubY'><ins id='BOubY'></ins><ul id='BOubY'></ul><sub id='BOubY'></sub></form><legend id='BOubY'></legend><bdo id='BOubY'><pre id='BOubY'><center id='BOubY'></center></pre></bdo></b><th id='BOubY'></th></span></q></dt></tr></i><div id='BOubY'><tfoot id='BOubY'></tfoot><dl id='BOubY'><fieldset id='BOubY'></fieldset></dl></div>