Using PUT /wiki/rest/api/content/{id} to update a page.
API call work when I send a request from Postman but not from c# code.
As an experiment, I have just get content from a page, and then update page.
If I send request from Postman it works but not from code.
I checked requests in Fiddler and they are almost identical (at least I cannot find difference)
Any ideas how can I troubleshoot it?
And give you a bit more details of how I did the test
-
it debugger I have copied and then pasted json content to Postman ( API call works)
-
in the code, only 2 statements left to make a API call
var data = new StringContent(json, Encoding.UTF8, “application/json”);
response = await _client.PutAsync(url, data); - client is a standard HttpClient
And … for some pages, everything works OK. for more complex not - for example, it does not with pretty simple table.
Any help will be appreciated.