Skip to content

Commit

Permalink
Doc: provide usage for APIResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyti committed Oct 2, 2024
1 parent c7f5442 commit 03b39c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/playwright/api_response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ defmodule Playwright.APIResponse do
@moduledoc """
`Playwright.APIResponse` represents responses returned by
`Playwrigh.APIRequestContext.fetch/3` and similar.
## Usage
request = Playwright.request(session)
context = APIRequest.new_context(request)
response = APIRequest.get(context, "https://example.com")
json = APIResponse.json(response)
"""

alias Playwright.APIRequestContext
Expand Down
1 change: 1 addition & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ defmodule Playwright.MixProject do
Playwright,
Playwright.APIRequest,
Playwright.APIRequestContext,
Playwright.APIResponse,
Playwright.Browser,
Playwright.BrowserContext,
Playwright.BrowserType,
Expand Down

0 comments on commit 03b39c5

Please sign in to comment.