sendForm.js 403 B

12345678910111213141516
  1. export const sendForm = async (POST_URL, userData) => {
  2. try{
  3. const response = await fetch(POST_URL, {
  4. method: 'POST',
  5. body: JSON.stringify(userData),
  6. headers: {
  7. 'Content-Type': 'application/json'
  8. }
  9. });
  10. const json = await response.json();
  11. console.log(json);
  12. } catch (e){
  13. console.log(e)
  14. }
  15. }