Skip to content

Unable to call the subscribe api using Axios in React frontend #377

@eakenbor

Description

@eakenbor

Calling the url "//subscribe/" using axios from a React frontend does not work when the user is not authenticated. However, it works on Postman when using form-data instead of the request body.

Here is my code:

const formData = new FormData()
formData .append("email_field", "[email protected])
axios.post("/<general-newsletter/subscribe/", formData )

On sending, nothing happens in the backend instead of registering the email as an unactivated subscription.

Please can someone help me with this?

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