AsyncDataWriter.js 252 B

123456789101112
  1. export class AsyncDataWriter {
  2. async post(filePath, data) {
  3. let response = await fetch(filePath, {
  4. method: 'POST',
  5. headers: {
  6. 'Content-Type': 'application/json'
  7. },
  8. body: JSON.stringify(data)
  9. });
  10. return response.json();
  11. }
  12. }