Skip to content

Commit b4b125c

Browse files
Improve README.md
add example on how to get json response
1 parent ea24d2d commit b4b125c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { get, post, put, patch, destroy } from '@rails/request.js'
5555
async myMethod () {
5656
const response = await post('localhost:3000/my_endpoint', { body: JSON.stringify({ name: 'Request.JS' }) })
5757
if (response.ok) {
58+
const body = await response.json
5859
...
5960
}
6061
}

0 commit comments

Comments
 (0)