Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • David Zweben 268 posts 754 karma points
    May 13, 2019 @ 17:04
    David Zweben
    0

    Using contentResource.save without files in Umbraco 8

    Hi,

    I am trying to use Umbraco 8's backoffice (Angular) API to save a new node via contentResource.save(). When calling this method in Umbraco 7, I passed an empty array to the file parameter when I didn't have a file to upload.

    In Umbraco 8, I am getting the following error when I do this:

    Message: "An error has occurred."
    ExceptionMessage: "Required property 'id' not found in JSON. Path '', line 1, position 145."
    ExceptionType: "Newtonsoft.Json.JsonSerializationException"
    

    How can I provide a valid empty value to the files parameter of contentResource.save() in Umbraco 8?

  • David Zweben 268 posts 754 karma points
    May 13, 2019 @ 17:31
    David Zweben
    100

    Never mind, the error was caused by an unrelated mistake on my part. You can still pass an empty array to the files parameter in Umbraco 8!

Please Sign in or register to post replies

Write your reply to:

Draft