From b4b125cc12ee6edfbe3536dc6ec6d05dcf3384b8 Mon Sep 17 00:00:00 2001 From: Glauco Custodio Date: Tue, 29 Oct 2024 09:24:13 +0000 Subject: [PATCH] Improve README.md add example on how to get json response --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 04bb462..874e1d0 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ import { get, post, put, patch, destroy } from '@rails/request.js' async myMethod () { const response = await post('localhost:3000/my_endpoint', { body: JSON.stringify({ name: 'Request.JS' }) }) if (response.ok) { + const body = await response.json ... } }