Skip to content

docs: Add documentation on non-2xx status code handling#583

Open
micahjsmith wants to merge 1 commit intohashicorp:mainfrom
micahjsmith:patch-1
Open

docs: Add documentation on non-2xx status code handling#583
micahjsmith wants to merge 1 commit intohashicorp:mainfrom
micahjsmith:patch-1

Conversation

@micahjsmith
Copy link
Copy Markdown

Description

The documentation is not explicit about whether non-2xx status codes cause the request to fail and whether the user should handle 4xx codes like 429. However, from https://github.com/hashicorp/terraform-provider-http/blob/main/CHANGELOG.md#300-july-27-2022 it is clear that the request succeeds in this case and the user should in fact use a postcondition if they require a success response.

Rollback Plan

n/a - docs only change

Changes to Security Controls

n/a - docs only change

The documentation is not explicit about whether non-2xx status codes cause the request to fail and whether the user should handle 4xx codes like 429. However, from https://github.com/hashicorp/terraform-provider-http/blob/main/CHANGELOG.md#300-july-27-2022 it is clear that the request succeeds in this case and the user should in fact use a postcondition if they require a success response.
@micahjsmith micahjsmith requested a review from a team as a code owner December 19, 2025 15:52
@hashicorp-cla-app
Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@hashicorp-cla-app
Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@micahjsmith micahjsmith changed the title Add documentation on non-2xx status code handling docs: Add documentation on non-2xx status code handling Dec 19, 2025
Copy link
Copy Markdown
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

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

Hi @micahjsmith 👋🏻, thanks for the PR!

This seems like a reasonable change to me, although you'll need to do two things before we can merge it:

  1. The documentation is actually generated (make generate on your local machine) from the schema, which can be found here:
    Description: `
    The ` + "`http`" + ` data source makes an HTTP GET request to the given URL and exports
    information about the response.
    The given URL may be either an ` + "`http`" + ` or ` + "`https`" + ` URL. This resource
    will issue a warning if the result is not UTF-8 encoded.
    ~> **Important** Although ` + "`https`" + ` URLs can be used, there is currently no
    mechanism to authenticate the remote server except for general verification of
    the server certificate's chain of trust. Data retrieved from servers not under
    your control should be treated as untrustworthy.
    By default, there are no retries. Configuring the retry block will result in
    retries if an error is returned by the client (e.g., connection errors) or if
    a 5xx-range (except 501) status code is received. For further details see
    [go-retryablehttp](https://pkg.go.dev/github.com/hashicorp/go-retryablehttp).
    `,
    So you'll need to update that location as well (eventually when we run the CI you'd get an error message describing that).
  2. HashiCorp requires that you sign the CLA agreement before we can merge the PR, it looks like our internal bot added two comments to the PR, but both links should be the same: #583 (comment) . If you sign that (or already have) and the PR doesn't update to reflect that, let me know and I'll check with the folks internal who run that 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants