代码之家  ›  专栏  ›  技术社区  ›  John Sheehan

如何为此API构建clientaccesspolicy.xml?

  •  0
  • John Sheehan  · 技术社区  · 14 年前

    我有一个restlike API,我想从Silverlight访问它。它需要支持以下内容:

    • 所有请求都通过SSL进行
    • 允许GET、POST、PUT、DELETE(或任何)
    • 允许任何请求头
    • 允许来自任何主机的请求

    非常开阔。我对这些文件有点困惑,所以有没有人能举个例子来说明它是什么样子的?

    3 回复  |  直到 14 年前
        1
  •  2
  •   Dan Auclair    14 年前

    <?xml version="1.0" encoding="utf-8" ?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from http-request-headers="*" http-methods="*">
            <domain uri="https://*" />
          </allow-from>
          <grant-to>
            <resource path="/" include-subpaths="true"/>
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>
    

    http-methods="*"

    推荐文章