@sowndharya I believe you need to send the X-CSRF-Token in the header of your...

Contribution Date
Technology
Contribution Project
Contribution Details

@sowndharya I believe you need to send the X-CSRF-Token in the header of your request. Here is an example of how to send it:

const message = { 'webform_id' : 'contact', 'name' :[{'value': 'Test' }], 'email' :[{'value': 'test@gmail.com'}], 'subject' :[{'value': '123456789'}], 'message' :[{'value': 'Hello'}] } const token = 'you_need_to_get_this_from_somewhere' fetch(`/entity/webform_submission?_format=json`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': token }, body: JSON.stringify(message) })

Notice: Simplifying the 'webform_id' property structure as above works for me or else I get an error saying it can't find the webform_id.

Issue Status
closed
Contribution Author
Files count
0
Patches count
0