mirror of https://github.com/smithy-lang/smithy-rs
e3f0de42db
This issue addresses a semver compatibility problem similar to the one described in #3318, except for the `aws_smithy_http::operation::Metadata` type. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ |
||
---|---|---|
.. | ||
examples | ||
src | ||
Cargo.toml | ||
README.md |
README.md
smithy-rs Client Examples
This package contains some examples on how to use the Smithy Client to communicate with a Smithy-based service.
Pre-requisites
- Build the
pokemon-service-client
andpokemon-service
by invokingmake
in the examples folder.
make
- Run the Pokemon service locally by issuing the following command from the examples folder. This will launch the Smithy-Rs based service on TCP port 13734.
cargo run --bin pokemon-service
Running the examples
You can view a list of examples by running cargo run --example
from the
pokemon-service-client-usage
folder. To run an example, pass its name to the cargo run --example
command, e.g.:
cargo run --example simple-client
List of examples
Rust Example | Description |
---|---|
simple-client | Creates a Smithy Client and calls an operation on it. |
endpoint-resolver | How to set a custom endpoint resolver. |
handling-errors | How to send an input parameter to an operation, and to handle errors. |
custom-header | How to add headers to a request. |
custom-header-using-interceptor | How to access operation name being called in an interceptor. |
response-header-interceptor | How to get operation name and access response before it is deserialized. |
use-config-bag | How to use the property bag to pass data across interceptors. |
retries-customize | Customize retry settings. |
retries-disable | How to disable retries. |
timeout-config | How to configure timeouts. |
mock-request | Use a custom HttpConnector / Client to generate mock responses. |
trace-serialize | Trace request and response as they are serialized / deserialized. |
client-connector | Shows how to change TLS related configuration. |