Forum Discussion
Paul Summers
Microsoft
Sep 07, 2016Use SharePoint Framework and Search API
I am trying to build a search-driven app using the new SharePoint Framework. Whenever I use the built-in HTTP client, I get a 500 error for search. The same GET request runs fine in the same browser ...
Luis Mañez
Sep 08, 2016MVP
Have you tried this code from Chris O'Brien?
http://www.sharepointnutsandbolts.com/2016/08/async-rest-calls-promises-httpclient-jquery.html
seems that you need some kind of workaround when calling search API
// workaround for httpClient/search API issue..
headers: {
"odata-version": ""
}}Seems not required if you use jQuery AJAX...
Let us know if it works.