From 050608027b8d9dc9f3db82314ca7281bb1ca629e Mon Sep 17 00:00:00 2001 From: Himanshu Patil <142312496+hpinmetaverse@users.noreply.github.com> Date: Sat, 2 May 2026 21:57:30 +0530 Subject: [PATCH] docs: improve GET request example clarity in documentation. (#10836) * Improve GET request example clarity in documentation. Updated example GET request to use params for clarity. * Fix indentation in GET request example --------- Co-authored-by: Jay --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e330484..1d3d0aa2 100644 --- a/README.md +++ b/README.md @@ -495,8 +495,16 @@ axios // Want to use async/await? Add the `async` keyword to your outer function/method. async function getUser() { try { - const response = await axios.get('/user?ID=12345'); - console.log(response); +// Example: GET request with query parameters +const response = await axios.get('/user', { + params: { + ID: 12345 + } +}); + +// Using the `params` option improves readability and automatically formats query strings + +console.log(response); } catch (error) { console.error(error); }