Skip to main content

azure_core/http/request/options/
mod.rs

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4//! Options sent with requests to the service.
5
6use crate::http::headers::CLIENT_REQUEST_ID;
7pub use typespec_client_core::http::request::options::*;
8use typespec_client_core::request_header;
9
10request_header!(
11    /// The `x-ms-client-request-id` header.
12    ///
13    /// # Examples
14    ///
15    /// Add a caller-defined client request ID to a request.
16    ///
17    /// ```
18    /// use azure_core::{
19    ///     http::{ClientMethodOptions, request::options::ClientRequestId},
20    ///     Uuid,
21    /// };
22    /// let client_request_id: String = Uuid::new_v4().into();
23    /// let mut options = ClientMethodOptions::default();
24    /// options.context.insert(ClientRequestId::new(client_request_id));
25    /// ```
26    ClientRequestId,
27    CLIENT_REQUEST_ID,
28);