Search code examples
microsoft-graph-apionenote-api

No HTTP resource was found that matches the request


I tried to replace the Page content using Microsoft Graph like this:

MultipartFormDataContent form = new MultipartFormDataContent();
form.Add( some stream contents );
var formdatastream = form.ReadAsStreamAsync();
graphClient.Users[userPrincipalName]
  .Onenote
  .Pages[onenotepage.Id]
  .Content
  .Request()
  .PutAsync<OnenotePage>(formdatastream);

It returns No HTTP resource was found that matches the request, which implies that it does not accept an HTTP PUT request.

Clearly, it is saying it accepts HTTP Patch so maybe the .Net library needs to be changed?


Solution

  • This is a known issue and is a result of a mismatch of the service definition and the service behavior.

    If you search for 'onenoteupdatepage' in the OneNote SDK tests, you can see one possible workaround for how to replace an existing page.