문제

I've followed the steps from the following answer: sharepoint 2013 anonymous 401 UNAUTHORIZED1

However, it works partially for me. The REST calls works when I try to access basic information from any list, but when I call 'FieldsValuesAsHtml' endpoint, the response is 401 Unauthorized.

enter image description here

도움이 되었습니까?

해결책 2

Finally, I was able to solve the problem. In order to 'FieldValuesAsHtml' endpoints get to work with both Anonymous and registered users, you have to make the request with POST method and empty body passing the header X-RequestDigest and it's value.

I was able to get the header value from this endpoint: /_api/contextinfo. Just be sure to call this before every 'FieldValuesAsHtml' requests.

다른 팁

Check whether the following REST API works or not.

/_api/web/lists/getbytitle('listname')/items(28)

And then check the REST API below.

/_api/web/lists/getbytitle('listname')/items(28)?$expand=FieldValuesAsHtml
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top