Title: Issue with sending data using WP REST API
Last modified: January 22, 2023

---

# Issue with sending data using WP REST API

 *  [andrijafzv](https://wordpress.org/support/users/andrijafzv/)
 * (@andrijafzv)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/issue-with-sending-data-using-wp-rest-api/)
 * I am using Contact Form 7 on my WordPress site and trying to send data to it 
   using the WP REST API from my Next.js app. I am sending a POST request to the
   URL [https://my-site.com/wp-json/contact-form-7/v1/contact-forms/369/feedback](https://my-site.com/wp-json/contact-form-7/v1/contact-forms/369/feedback)
   but I am receiving a “mail_sent” status and “Thank you for your message. It has
   been sent.” message as a response, but the email that I receive has no data.
 * I have verified that the values of the form fields are correctly being passed
   to the FormData object and the request headers and body are also fine. But the
   email received is still empty.
 * This is my function for sending POST request:
 *     ```wp-block-code
       const handleSubmit = async (e) => {
   
       e.preventDefault();
   
       validateName(name) && validateEmail(email) && validateMessage(message);
   
       if (
   
       formIsValid &&
   
       nameError === null &&
   
       emailError === null &&
   
       messageError === null
   
       ) {
   
       try {
   
       let formData = new FormData();
   
       formData.append("your-name", name);
   
       formData.append("your-email", email);
   
       formData.append("your-message", message);
   
       for (const [key, value] of formData.entries()) {
   
       console.log(key, value);//when i console.log this, i see key value pairs in console
   
       }
   
       const response = await fetch(
   
       https://my-site.com/wp-json/contact-form-7/v1/contact-forms/369/feedback,
   
       {
   
       method: "POST",
   
       headers: {
   
       "Content-Type": "multipart/form-data",
   
       },
   
       body: formData,
   
       }
   
       );
   
       } catch (error) {
   
       console.error(error);
   
       }
   
       } else {
   
       console.log("form is not valid");
   
       }
   
       };
       ```
   
 * Can you please take a look and let me know what might be causing this issue?
 * Thank you.

Viewing 1 replies (of 1 total)

 *  [fancybear007](https://wordpress.org/support/users/fancybear007/)
 * (@fancybear007)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/issue-with-sending-data-using-wp-rest-api/#post-16909343)
 * Have you found the solution?

Viewing 1 replies (of 1 total)

The topic ‘Issue with sending data using WP REST API’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [wp rest api](https://wordpress.org/support/topic-tag/wp-rest-api/)

 * 1 reply
 * 2 participants
 * Last reply from: [fancybear007](https://wordpress.org/support/users/fancybear007/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/issue-with-sending-data-using-wp-rest-api/#post-16909343)
 * Status: not resolved