Skip to content
Advertisement

Nodejs send post to admin-ajax.php in wordpress /getting 400 error and 0

i want to post to wordpress on nodejs using admin-ajax.php which set some actions to use. But i get statusCode:400 and 0, i don’t know so much about wordpress and ajax. I tried use a cookie from the worked project from wordpress that what i want to transfer nodejs How can i set up this?

JavaScript

Advertisement

Answer

Latest Changes: added wordpress_logged_in to cookie, changed req.write to req.write(data); added content type: urlencoded and change data to url encoded

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement