DEV Community

Discussion on: React - Testing Network Requests in 3 Simple Steps

Collapse
 
kettanaito profile image
Artem Zakharchenko

A great overview, Chris!

One thing I'd point out, is that you don't have to specify query parameters when declaring the request URL in your handler:

-https://randomuser.me/api/?inc=name
+https://randomuser.me/api/
Enter fullscreen mode Exit fullscreen mode

Query parameters don't describe the path to the requested resource and should be dropped. The values of those parameters can still be accessed under req.url.searchParams in your resolver if you need them.

Collapse
 
chrislemus profile image
Chris

I've updated the request URL in my handler. Thanks for the feedback!