Example of using the SharePoint 2013 Search REST API

Source: Internet
Author: User
Tags http post

In SharePoint2013, you provide search rest service searching services that you can use in your own client search method or mobile application that supports REST Web request. You can use keyword Query Language (KQL) or fast query Language (FQL) to search for the REST service, and to try out with remote client applications, mobile applications, and other applications.

One, Search REST service

Support mode:

Search REST Service supports HTTP POST mode and HTTP GET requests mode

Get requests:

Url:http://server/_api/search/query

Get way you have two ways of communicating, as follows:

Http://server/_api/search/query?query_parameter=value&query_parameter=value

Http://server/_api/search/query (query_parameter=value&query_parameter=<value>)

POST requests:

Url:http://server/_api/search/postquery

In post mode, you can use JavaScript Object notation (JSON) to pass the argument

There are three different scenarios for post methods:

Get mode, url exceeds the length limit, only use post method;

The query condition is very complex, get way is difficult to meet the need, use post method;

For certain parameters, only post methods are supported.

Two, get way to view return XML

1, in my Configuration Good search page, search "Beijing", the following figure, there are 4 results

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/web/sharepoint/

2, using Get method to return the XML, after _api/search/query add querytext parameter "Beijing" Escape Value "%e5%8c%97%e4%ba%ac"

http://URL/_api/search/query?querytext= '%e5%8c%97%e4%ba%ac '

(The returned XML screenshot)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.