Sur le developer.microsoft.com/en-us/graph/graph-explorer
je tente de poster une demande de page créer dans OneNote et le code par défaut qui obtient peuplé dans l'en-tête de demande ressemble à ceci:API Microsoft Graph Demande corps ne fonctionne pas
KEY: Content-type VALUE: multipart/form-data
boundary MyPartBoundary198374
Et les regards du corps de demande comme ceci:
--MyPartBoundary198374
Content-Disposition:form-data; name="Presentation"
Content-Type:text/html
<!DOCTYPE html>
<html>
<head>
<title>A page with <i>rendered</i> images and an <b>attached</b> file</title>
<meta name="created" content="2015-07-22T09:00:00-08:00" />
</head>
<body>
<p>Here's an image from an online source:</p>
<img src="http://..." alt="an image on the page" width="500" />
<p>Here's an image uploaded as binary data:</p>
<img src="name:imageBlock1" alt="an image on the page" width="300" />
<p>Here's a file attachment:</p>
<object data-attachment="FileName.pdf" data="name:fileBlock1" type="application/pdf" />
</body>
</html>
--MyPartBoundary198374
Content-Disposition:form-data; name="imageBlock1"
Content-Type:image/jpeg
... binary image data ...
--MyPartBoundary198374
Content-Disposition:form-data; name="fileBlock1"
Content-Type:application/pdf
... binary file data ...
--MyPartBoundary198374--
L'aperçu de réponse me donne toujours une erreur en disant:
Page create requests require the content to be multipart, with a presentation part.
Considérant les en-têtes de demande et le corps de la demande a été généré par Microsoft ne devrait pas ce travail? J'ai la bonne section-id pour écrire sur la page, donc je suis assez confus.
Je me sens stupide de perdre 10 minutes à ce sujet, mais cela est la bonne réponse. L'explorateur graphique doit être pré-rempli avec le bon contenu. – Gvancha
@Gvancha ouais ce fut une douleur pour moi quand je me suis d'abord bagarré avec le problème lol –