JSFiddle - React, Tailwind, and code Playground

by Eugen Sunic

HTML

<ul>
  <li>prvi</li>
  <li>drugi</li>
  <li>treci</li>
</ul>

JavaScript

fetch('http://oceantechnosys.com/oceantechnosys/demo/sonu/api-react/user_registration.php', {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      email: this.state.UserEmail,
      password: this.state.UserPassword,
    }),
  })
  .then(response => response.json())
  .then(responseJson => {
    // Showing response message coming from server after inserting records.
    alert(responseJson);
  })