1 pièce(s) jointe(s)
Comment enregistrer correctement ma variable html ?
Bonjour,
j'ai un wysiwig que j'édite avec contenteditable, et j'essaye d'envoyer mes données correctement, mais cela ne fonctionne pas car je sais pas le faire correctement.
coté front-end angular voici mon bout de script:
Code:
1 2 3 4 5 6 7 8 9 10 11
| console.log("publcation =======<<<<<<<<<");
console.log(updatePublication);
let req = this.http.put(
"http://localhost:8080/publications/5",'{"id":5,"htmlPublication":'+updatePublication+'}', {headers:new HttpHeaders(
{
'Authorization':localStorage.getItem('token'),
'Content-Type': 'application/json',
}
)}
); |
voici ce que me donne updatePublication:
Pièce jointe 486224
j'essaye de transmettre mon contenu html mais j'ai une erreur 400.
voici ce qu me donne côté boot:
Citation:
2019-06-25 09:50:22.132 ERROR 10092 --- [nio-8080-exec-4] o.s.d.r.w.RepositoryRestExceptionHandler : Could not read an object of type class sklt.entities.Publication from the request!; nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'object': was expecting ('true', 'false' or 'null')
at [Source: (org.apache.catalina.connector.CoyoteInputStream); line: 1, column: 35]
comment je dois procéder ?
merci de vos réponses :)