共用方式為


URL Protocol

Applies to: SharePoint Foundation 2010

The following table lists the SharePoint Foundation RPC Protocol methods that can be used in URL protocol to make HTTP GET requests. For more information about a specific method, click the command to see the related RPC method topic.

Note

The ability for URL commands to return HTML, such as Display in the following table, has become limited by security changes in Microsoft SharePoint Foundation. If strict browser file handling is enabled, the return data will be marked as an attachment and forced for download. This applies to the URL commands in general, but especially to the commands that are meant to render the results directly in the browser.

Command (Cmd=)

Description

Parameters

dialogview

A special parameter that is used within the Cmd=Display command that opens a view of the document libraries within a site, a view of a specific document library, or a view of a folder within a document library that is used in a dialog box for opening or saving files; or opens the property form that is used when saving a file.

dialogview, location, FileDialogFilterValue

Display

Runs a database query against the list specified by a GUID and returns XML or HTML.

List, XMLDATA, View, Query, Using, CacheControl, ID

ExportList

Exports in Collaborative Application Markup Language (CAML) format the schema of the list specified by a GUID.

List

GetProjSchema

Requests the XML schema for a Web site.

SiteTemplate

GetUsageBlob

Returns information about the usage of a Web site.

BlobType

HitCounter

Generates a hit on a page that contains a hit counter.

Page, Image, Custom, Digits

RenderView

Requests the contents of a view for the list specified by a GUID.

List, View, URLBase

The following parameters can also be used in the protocol:

  • FileDialogFilterValue to set filters for a view and to return the list of all files of a specified type from a document library according to file name extension (for example, *.doc, *.ppt, or *.xls).

  • FilterFieldn to specify the name of a field in the database, where n is an integer that is limited only by the number of fields allowed in the database table or by the length allowed for the URL field.

  • FilterValuen to specify the string value on which to filter a field, where n is an integer that is limited only by the length allowed for the URL field.

  • SortField to specify the name of the field on which to sort.

  • SortDir to indicate an ascending (asc) or descending (desc) sort order.

  • Using to specify the relative URL of a virtual file that is used in exporting an item or list, which can be one of the following values: vcard.vcf, event.ics, query.iqy, or query.bqy.

Using the URL Protocol

Embedding a request in a URL is a basic mechanism for issuing a method and its parameters to a server that is running SharePoint Foundation. The syntax for using this mechanism is as follows.

http://Server_Name/[sites/][Site_Name/]_vti_bin/owssvr.dll?Cmd=
   Method_name[&Parameter1=Value1&Parameter2=Value2...]

This example exports the schema of the list specified by a GUID.

http://Server_Name/[sites/][Site_Name/]_vti_bin/owssvr.dll?Cmd=
   ExportList&List=GUID

This example displays the Discussions list as a CAML file.

http://Server_Name/[sites/][Site_Name/]_vti_bin/owssvr.dll?Cmd=
   Display&List=GUID&XMLDATA=TRUE

The next example exports the Discussions list to a Microsoft Excel worksheet. Note that the GUID for the associated view must be assigned to the View parameter.

http://Server_Name/[sites/][Site_Name/]_vti_bin/owssvr.dll?CS=
   109&Using=_layouts/query.iqy&List=GUID&View=GUID&CacheControl=1

For information about how to use URL protocol to post requests, see How to: Post SharePoint Foundation RPC Methods.