Skip to content

Part 1.3: Populating our pages using JavaScript #6

@camp5456

Description

@camp5456

Around this step, I couldn't get my list of recipes to display. I'm not sure if debugging utils.js is part of the presentation -- if it is, please close this issue.

It turned out that datasetd expects a Content-Type header even for empty POST requests, so I added "Content-Type": "application/x-www-form-urlencoded" to the fetch call in getRecipes(), and that fixed it.

Here’s the terminal error. Again, I'm not sure if debugging that is part of the workshop or not. But I thought I’d mention in case it wasn’t.

ERROR request URL: POST "/api/recipes.ds/query/list_recipes" statusText: "Bad Request", statusCode: 400, errorRedirect: "unsupported content type, "

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions