Enhanced Quickstart and Basic usage pages#576
Conversation
Expanded the proxy usage documentation to include authentication, per-request proxies with custom headers, and clarified Unix socket proxy usage.
Updated the proxy usage example to reflect the new Client initialization with a list of proxies.
Fix formatting of bullet points in quickstart.md
More context added. And anchoring to API references for easy navigation between classes and models. To learn how to use it better
Updated examples for GET and POST requests, including form data and headers. Improved clarity and consistency in code snippets.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDocumentation updates across three guide files: examples rewritten to use current API patterns (response variable, await response.text()/json(), params/data/json), proxy examples switched to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
docs/source/getting-started/quickstart.md (1)
179-182: UseStatusErrorinstead of broadExceptionwhen catchingraise_for_status()errorsThe documentation example should catch the specific
StatusErrorexception instead of broadException, and use the correctresponse.statusattribute.Suggested doc fix
+from wreq.exceptions import StatusError ... try: response.raise_for_status() -except Exception as exc: - print(f"Request failed with status {response.status_code}") +except StatusError: + print(f"Request failed with status {response.status}")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/source/getting-started/quickstart.md` around lines 179 - 182, The example currently catches a broad Exception from response.raise_for_status(); change the except clause to catch the specific StatusError (e.g., except StatusError as exc) and update the log message to use response.status instead of response.status_code; keep the descriptive message and include the caught exc if desired for more context.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/source/getting-started/quickstart.md`:
- Around line 46-51: Update the quickstart examples to use the correct async API
names: replace any use of the `params` argument with `query`, replace `data`
with `form`, and change `response.status_code` to `response.status`; update the
examples around the `client.get`/`client.post` calls and their `response`
handling (e.g., where `params`, `data`, or `status_code` are referenced) so they
call `client.get(..., query=...)`, `client.post(..., form=...)`, and access
`response.status` instead of `response.status_code`.
In `@docs/source/guide/basic.md`:
- Line 161: The prose currently references resp.stream() but the examples use
response; update the paragraph to use response.stream() so naming is consistent
with the examples — replace any occurrence of resp.stream() with
response.stream() in the explanatory text (keep the example code unchanged) to
align the symbol naming with the surrounding examples.
- Line 129: The API link to HeaderMap has a typo in its anchor (`h=HeaerMap`)
which breaks search/highlight; update the anchor to the correct spelling
(`h=HeaderMap`) in the Markdown link that references HeaderMap (the text
"HeaderMap" in the line using wreq uses a
[HeaderMap](../api/header.md?h=HeaerMap#wreq.header.HeaderMap)) so the query
param and anchor match the actual symbol HeaderMap.
In `@docs/source/guide/proxy.md`:
- Line 35: The markdown uses fenced code blocks for examples like the line
containing proxies=[Proxy.all("http://proxy.example.com:8080")] (and similarly
at the other listed occurrences) which triggers MD046; replace those fenced
blocks with indented code blocks (4-space indentation) so examples such as
Proxy.all(...) are formatted as indented code instead of fenced style, ensuring
all occurrences (lines near the shown instances: 35, 48, 61, 69, 78, 88, 101,
112, 123, 146) are converted consistently.
- Around line 103-114: The docs incorrectly show per-request examples using the
plural "proxies=[...]" while the Request API expects a singular "proxy" option;
update the examples that use Proxy.all(...) (lines with Proxy.all and the
Request examples) to pass the Proxy instance via the "proxy=" keyword instead of
"proxies=[...]" and ensure any example text mentions per-request uses Request
TypedDict's proxy: NotRequired[Proxy] (instead of module-level proxies:
NotRequired[Sequence[Proxy]]).
---
Nitpick comments:
In `@docs/source/getting-started/quickstart.md`:
- Around line 179-182: The example currently catches a broad Exception from
response.raise_for_status(); change the except clause to catch the specific
StatusError (e.g., except StatusError as exc) and update the log message to use
response.status instead of response.status_code; keep the descriptive message
and include the caught exc if desired for more context.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3fb9c345-04be-470e-88f0-67a52f8361fa
📒 Files selected for processing (3)
docs/source/getting-started/quickstart.mddocs/source/guide/basic.mddocs/source/guide/proxy.md
Added more content and explanations.
Summary by CodeRabbit