I am trying to connect to a SharePoint URL and pull the data in the form of a
.json file. My URL looks like this:
If I give the URL as it is without any encoding, it fails with a
HTTP/1.1 400 Bad Request error. I tried using
--data-urlencode as follows:
curl -v -G -L --ntlm --user user:password -H 'Accept: application/json;odata=verbose' ".../_api/web/lists/GetByTitle" --data-urlencode "('titles list')" -d "/items"
Doing this converts my URL to
But it fails with
HTTP/1.1 404 Not Found since using
-G will append a
& to the URL. Having the
& present will give me a different URL and hence the
404 not found error.
I have no issues accessing other end points such as
../_api/web/lists since - I believe - there is no need to encode this URL?
How do I properly encode my URL and get the data without any errors?