Skip to content

Enhanced Quickstart and Basic usage pages#576

Merged
0x676e67 merged 7 commits into
0x676e67:mainfrom
mrcsnv:main
Apr 18, 2026
Merged

Enhanced Quickstart and Basic usage pages#576
0x676e67 merged 7 commits into
0x676e67:mainfrom
mrcsnv:main

Conversation

@mrcsnv
Copy link
Copy Markdown
Contributor

@mrcsnv mrcsnv commented Apr 16, 2026

Added more content and explanations.

Summary by CodeRabbit

  • Documentation
    • Revised quickstart into a broader "Making a Request" guide with examples for query parameters, reading responses (status, text, JSON, headers), sending JSON/form bodies, proxy usage, browser emulation, and error handling.
    • Reorganized basic guide into clear GET/POST/query/header/streaming sections with consistent examples and simplified streaming.
    • Updated proxy guide to demonstrate per-request proxy configuration and Unix socket usage.

mrcsnv added 6 commits April 14, 2026 15:07
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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 263f6dbf-401b-424a-8687-4e9a9dbcee96

📥 Commits

Reviewing files that changed from the base of the PR and between 3b7d2a3 and ef65aed.

📒 Files selected for processing (2)
  • docs/source/getting-started/quickstart.md
  • docs/source/guide/proxy.md

📝 Walkthrough

Walkthrough

Documentation 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 Proxy constructors with proxies=[...], and new sections added for browser emulation and error handling.

Changes

Cohort / File(s) Summary
Quickstart Guide
docs/source/getting-started/quickstart.md
Expanded into a "Making a Request" guide: renamed example variables to response, switched to response.status, added query parameter examples (params / response.url), detailed response-reading (await response.text(), await response.json(), headers), added sending data examples (json= and data=), clarified proxy usage with Proxy.* and Client(proxies=[...]), added "Browser Emulation" and "Error Handling" sections.
Basic Usage Guide
docs/source/guide/basic.md
Reorganized into "Making Requests" subsections (GET, POST JSON, Form Data, Query Params, Headers, Streaming); updated examples to wreq.get() / wreq.post() using response, changed endpoints to https://httpbin.org/..., simplified streaming to async for chunk in response.stream(), removed redundant if __name__ == "__main__" blocks and explicit Response typing.
Proxy Configuration Guide
docs/source/guide/proxy.md
Reworked proxy examples to use per-request proxies=[...] with Proxy.unix(...) for Unix sockets and aligned examples with Proxy.all()/http()/https()/unix() constructors; changed examples from proxy=... to list-based proxies parameter.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through docs at break of day,

I swapped old verbs and cleared the way,
Params and proxies now parade,
Emulation, errors neatly laid,
A little rabbit's tidy play. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Enhanced Quickstart and Basic usage pages' accurately summarizes the main changes, which involve improvements and expansions to the quickstart and basic usage documentation pages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (1)
docs/source/getting-started/quickstart.md (1)

179-182: Use StatusError instead of broad Exception when catching raise_for_status() errors

The documentation example should catch the specific StatusError exception instead of broad Exception, and use the correct response.status attribute.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 030c6c1 and 3b7d2a3.

📒 Files selected for processing (3)
  • docs/source/getting-started/quickstart.md
  • docs/source/guide/basic.md
  • docs/source/guide/proxy.md

Comment thread docs/source/getting-started/quickstart.md
Comment thread docs/source/guide/basic.md
Comment thread docs/source/guide/basic.md
Comment thread docs/source/guide/proxy.md
Comment thread docs/source/guide/proxy.md Outdated
@0x676e67 0x676e67 merged commit 36061bf into 0x676e67:main Apr 18, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants