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

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

      <legend id='iPvht'><style id='iPvht'><dir id='iPvht'><q id='iPvht'></q></dir></style></legend>
        <bdo id='iPvht'></bdo><ul id='iPvht'></ul>
      1. 用于 PHP 中 Bing 搜索的 Windows Azure 身份验证

        Windows Azure Authentication for Bing Search in PHP(用于 PHP 中 Bing 搜索的 Windows Azure 身份验证)

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

                <legend id='EPIAf'><style id='EPIAf'><dir id='EPIAf'><q id='EPIAf'></q></dir></style></legend>
                <tfoot id='EPIAf'></tfoot>
                • <small id='EPIAf'></small><noframes id='EPIAf'>

                  本文介绍了用于 PHP 中 Bing 搜索的 Windows Azure 身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 Windows Azure Marketplace API 执行必应搜索,我已经下载了他们的指南和示例代码.该代码准备了一个带有基本身份验证的 HTTPS 请求,但是我不断收到以下错误:

                  I am trying to perform a Bing Search by using the Windows Azure Marketplace API, I have downloaded their guide and sample code. The code prepares a HTTPS request with basic authentication, however I am constantly getting the following error:

                  警告:file_get_contents(https://api.datamarket.azure.com/Data.ashx/Bing/SearchWeb/Web?Query=%27washburn%27&Adult=%27Off%27&$top=50&$format=Atom): 无法打开流:连接被拒绝

                  php 代码(来自微软的文档):

                  The php code (from Microsoft's document):

                  $context = stream_context_create(array(
                      'http' => array(
                      'proxy' => 'tcp://127.0.0.1:8888',
                      'request_fulluri' => true,
                      'header'  => "Authorization: Basic " . base64_encode($accountKey.":".$accountKey)
                      )
                  ));
                  

                  请问有谁知道是什么原因造成的?我已正确设置 $accountKey 并在浏览器中对其进行了测试.让我有点困惑的是 127.0.0.1:8888base64_encode($accountKey.":".$accountKey) ,你怎么需要 $accountKey 之前和之后: 使用浏览器时,您应该将用户名留空,只需在密码字段中输入帐户密钥?

                  Does anyone know what is causing the error please? I have correctly set the $accountKey and I tested it in a browser. What puzzles me a little is 127.0.0.1:8888 and also base64_encode($accountKey.":".$accountKey) , how come you need the $accountKey both before and after the : while when using a browser you are supposed to leave the username blank and just input the account key into the password field?

                  推荐答案

                  我已经解决了,下面是我为将来会做同样事情的人发现的:

                  I have solved it and here is what I have found for future people that would be doing the same thing:

                  我注释掉了上面写着的那一行:

                  I commented out the line where it says:

                  'proxy' => 'tcp://127.0.0.1:8888',
                  'request_fulluri' => true,
                  

                  并设置 base64_encode("ignored:".$accountKey) 代替

                  根据我在 MSDN 上阅读的内容,据说用户名部分被忽略,因此它的值应该是什么并不重要.我在想可能是密钥中的长度或特殊字符搞砸了,所以我用 ignored (或其他任何东西)替换它.

                  Base on what I read on MSDN, the username part is said to be ignored, so it shouldn't matter what value it is. I was thinking perhaps the length or the special characters in the key screwed things up so I replaces it with ignored (or anything really).

                  成功了,我可以解析返回的 JSON 数据.祝你好运!

                  That did the trick and I can parse the returned JSON data. Good luck!

                  这篇关于用于 PHP 中 Bing 搜索的 Windows Azure 身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)

                  1. <small id='Cili5'></small><noframes id='Cili5'>

                      <tbody id='Cili5'></tbody>
                    • <bdo id='Cili5'></bdo><ul id='Cili5'></ul>
                        <legend id='Cili5'><style id='Cili5'><dir id='Cili5'><q id='Cili5'></q></dir></style></legend>

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