Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I can't understand why my PUT request for confluence doesn't work, 400 Bad request, please help me

Дольган Азыдов September 29, 2018

HttpResponseMessage responseGet = await client.GetAsync("rest/api/content/671023592?expand=body.view,version");
PageType components = await responseGet.Content.ReadAsAsync<PageType>();
++components.Version.Number;
components.Body.Storage = new Storage(components.Body.View.Value, components.Body.View.Representation);

HttpResponseMessage responseUpdate = await client.PutAsJsonAsync<PageType>("rest/api/content/671023592", components);

444.PNG

1 answer

0 votes
Дольган Азыдов September 30, 2018

i've found the answer. Using code
 var errorResp = await responseUpdate.Content.ReadAsAsync<Object>();

i see error message.

"Must supply an incremented version when updating Content. No version supplied."

It is confusing me because i specify the (incremented) number of version in the request...

Дольган Азыдов September 30, 2018

I fixed error with version.

Now i have error

{StatusCode: 500, ReasonPhrase: 'Internal Server Error'

without any additional info...

Maybe the reason is in the body value (HTML table with links), that i try to update...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events