0

I'm working on a Java app to access SharePoint 2016 via the REST interface. I've done this before with other SharePoint server versions, but I'm running into something odd this time:

If I make the REST request in a browser, the data comes back fine. If the same REST request is used in my app, I authenticate (I'm getting a 200 response and JSON back), but the JSON response does not contain the data:

{"d" : {"results" : [] }}

I am authenticating via NTLM using HttpsURLConnection with GET.

Accept: application/json;odata=verbose

User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; 
Trident/5.0)

Content-Type: text/xml; charset=utf-8

Connection: keep-alive 

Authentication is handled with the JCIFS library (Using NTLM authentication in Java applications see second answer)

Any thoughts?

stack0114106
  • 8,534
  • 3
  • 13
  • 38
  • 1. If SharePoint didn't return any authorization error then all things must be good. What REST API url you are using? May be some error there... 2. Another thing - i see you set Content-Type header to text/xml. I always used Content-Type: application/json;odata=verbose. May be it can be issue cause... –  Dec 12 '18 at 20:16
  • I'll give that a try, The REST Url works fine in a browser, so it is correct. – Richard Wymarc Dec 12 '18 at 20:39

0 Answers0