Categorygithub.com/microsoft/kiota-http-go
modulepackage
1.4.5
Repository: https://github.com/microsoft/kiota-http-go.git
Documentation: pkg.go.dev

# README

Kiota Http Library for Go

Go

The Kiota HTTP Library for Go is the Go HTTP library implementation with net/http.

A Kiota generated project will need a reference to a HTTP package to make HTTP requests to an API endpoint.

Read more about Kiota here.

Using the Kiota Http Library for Go

go get github.com/microsoft/kiota-http-go
httpAdapter, err := kiotahttp.NewNetHttpRequestAdapter(authProvider)

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

# Functions

GetClientWithAuthenticatedProxySettings creates a new default net/http client with a proxy url and default middleware Not providing any middleware would result in having default middleware provided.
GetClientWithProxySettings creates a new default net/http client with a proxy url and default middleware Not providing any middleware would result in having default middleware provided.
GetDefaultClient creates a new default net/http client with the options configured for the Kiota request adapter.
GetDefaultMiddlewares creates a new default set of middlewares for the Kiota request adapter.
GetDefaultMiddlewaresWithOptions creates a new default set of middlewares for the Kiota request adapter with options.
GetDefaultTransport returns the default http transport used by the library.
GetObservabilityOptionsFromRequest returns the observability options from the request context.
NewChaosHandler creates a new ChaosHandler with default configuration options of Random errors at 10%.
NewChaosHandlerWithOptions creates a new ChaosHandler with the configured options.
NewCompressionHandler creates an instance of a compression middleware.
NewCompressionHandlerWithOptions creates an instance of the compression middleware with specified configurations.
NewCompressionOptions creates a configuration object for the CompressionHandler.
NewCustomTransport creates a new custom transport for http client with the provided set of middleware.
NewCustomTransportWithParentTransport creates a new custom transport which relies on the provided transport for http client with the provided set of middleware.
NewHeadersInspectionHandler creates a new HeadersInspectionHandler with default options.
NewHeadersInspectionHandlerWithOptions creates a new HeadersInspectionHandler with the given options.
NewHeadersInspectionOptions creates a new HeadersInspectionOptions with default options.
NewNetHttpRequestAdapter creates a new NetHttpRequestAdapter with the given parameters.
NewNetHttpRequestAdapterWithParseNodeFactory creates a new NetHttpRequestAdapter with the given parameters.
NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactory creates a new NetHttpRequestAdapter with the given parameters.
NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient creates a new NetHttpRequestAdapter with the given parameters.
NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClientAndObservabilityOptions creates a new NetHttpRequestAdapter with the given parameters.
NewParametersNameDecodingHandler creates a new ParametersNameDecodingHandler with default options.
NewParametersNameDecodingHandlerWithOptions creates a new ParametersNameDecodingHandler with the given options.
NewRedirectHandler creates a new redirect handler with the default options.
NewRedirectHandlerWithOptions creates a new redirect handler with the specified options.
NewRetryHandler creates a new RetryHandler with default options.
NewRetryHandlerWithOptions creates a new RetryHandler with the given options.
NewUrlReplaceHandler creates a configuration object for the CompressionHandler.
NewUserAgentHandler creates a new user agent handler with the default options.
NewUserAgentHandlerOptions creates a new user agent handler options with the default values.
NewUserAgentHandlerWithOptions creates a new user agent handler with the specified options.
No description provided by the author
ReplacePathTokens invokes token replacement logic on the given url path.

# Constants

No description provided by the author
ChaosHandlerTriggeredEventKey is the key used for the open telemetry event.
ErrorBodyFoundAttributeName is the attribute name used to indicate whether the error response contained a body.
ErrorMappingFoundAttributeName is the attribute name used to indicate whether an error code mapping was found.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
ChaosHandlerOptions is a configuration struct holding behavior defined options for a chaos handler BaseUrl represent the host url for in ChaosStrategy Specifies the strategy used for the Testing Handler -> RANDOM/MANUAL StatusCode Status code to be returned as part of the error response StatusMessage Message to be returned as part of the error response ChaosPercentage The percentage of randomness/chaos in the handler ResponseBody The response body to be returned as part of the error response Headers The response headers to be returned as part of the error response StatusMap The Map passed by user containing url-statusCode info.
CompressionHandler represents a compression middleware.
CompressionOptions is a configuration object for the CompressionHandler middleware.
HeadersInspectionHandler allows inspecting of the headers of the request and response via a request option.
HeadersInspectionHandlerOptions is the options to use when inspecting headers.
NetHttpRequestAdapter implements the RequestAdapter interface using net/http.
ObservabilityOptions holds the tracing, metrics and logging configuration for the request adapter.
ParametersNameDecodingHandler decodes special characters in the request query parameters that had to be encoded due to RFC 6570 restrictions names before executing the request.
ParametersNameDecodingOptions defines the options for the ParametersNameDecodingHandler.
RedirectHandler handles redirect responses and follows them according to the options specified.
RedirectHandlerOptions to use when evaluating whether to redirect or not.
RetryHandler handles transient HTTP responses and retries the request given the retry options.
RetryHandlerOptions to apply when evaluating the response for retrial.
UrlReplaceHandler is a middleware handler that replaces url segments in the uri path.
UrlReplaceOptions is a configuration object for the UrlReplaceHandler middleware.
UserAgentHandler adds the product to the user agent header.
UserAgentHandlerOptions to use when adding the product to the user agent header.

# Interfaces

Middleware interface for cross cutting concerns with HTTP requests and responses.
ObservabilityOptionsInt defines the options contract for handlers.
Pipeline contract for middleware infrastructure.

# Type aliases

No description provided by the author