Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a method to pass custom headers and context #64

Merged
merged 16 commits into from
Sep 8, 2023

Conversation

aashishgurung
Copy link
Contributor

@aashishgurung aashishgurung commented Sep 7, 2023

1. Objective

Added SetCustomHeaders to pass custom headers to a request.
Added SetContext to pass the context to a request.

Usage

result := &omise.Account{}

// passing custom headers
client.WithCustomHeaders(map[string]string{
      "X-Header": "Header value",
})

// pass the context
client.WithContext(context.Background())

err := client.Do(result, &operations.RetrieveAccount{})

if err != nil {
    // handle error
}

@aashishgurung aashishgurung requested review from danfowler, ajzkk and a team September 7, 2023 03:50
@ajzkk ajzkk changed the title Added a method to pass custom headers. Added a method to pass custom headers and context Sep 7, 2023
@ajzkk ajzkk marked this pull request as draft September 7, 2023 10:16
@ajzkk ajzkk marked this pull request as ready for review September 7, 2023 10:32
client_test.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ajzkk ajzkk requested a review from danfowler September 8, 2023 03:44
@ajzkk ajzkk merged commit 94d2f33 into master Sep 8, 2023
@danfowler danfowler deleted the allow-custom-headers branch October 26, 2023 04:32
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.

3 participants