Skip to content

Commit

Permalink
Update api_response.ex w/ placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyti authored May 25, 2024
1 parent bebeba9 commit ce43ebb
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions lib/playwright/api_response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,39 @@ defmodule Playwright.APIResponse do
@property :status_text
@property :url

# @spec body(t()) :: binary() # or, equivalent of `Buffer`
# def body(response)

# @spec dispose(t()) :: :ok
# def dispose(response)

# @spec headers(t()) :: map()
# def headers(response)

# @spec headers(t()) :: map()
# def headers(response)

# def headers_array...
# will not implement. if it's determined that the JS/OOP version provides
# something meaningful over what `headers` provides, we'll do it differently.

# @spec json(t()) :: binary() # "serializable"; so, maybe map()?
# def json(response)

@spec ok(t()) :: boolean()
def ok(%APIResponse{} = response) do
response.status === 0 || (response.status >= 200 && response.status <= 299)
end

# @spec status(t()) :: number()
# def status(response)

# @spec status_text(t()) :: binary()
# def status_text(response)

# @spec text(t()) :: binary()
# def text(response)

# @spec url(t()) :: binary()
# def url(response)
end

0 comments on commit ce43ebb

Please sign in to comment.