pub struct Request { /* private fields */ }Expand description
One call of a service’s method, as its HTTP binding sends it. The generated clients build it.
Implementations§
Source§impl Request
impl Request
Sourcepub fn new(method: Method, path: impl Into<String>) -> Self
pub fn new(method: Method, path: impl Into<String>) -> Self
A call of method on path, the escaped path from the root.
Sourcepub fn with_query(self, query: Query) -> Self
pub fn with_query(self, query: Query) -> Self
Sends query as the query parameters.
Sourcepub fn idempotent(self) -> Self
pub fn idempotent(self) -> Self
Marks the call as one whose sending twice has the effect of sending it once: a read, or a mutation with a request id. Only such a call is retried.
Sourcepub fn unauthenticated(self) -> Self
pub fn unauthenticated(self) -> Self
Sends the call without the client’s credentials, to a method that authenticates no caller, such as the security token service’s: it then works with none.
It is sent without the consistency token too, and the token its
answer carries, if any, isn’t kept. In a browser it also carries no
User-Agent: only Accept, which a page may send to another
origin without asking first, and Content-Type with a body. So a
browser asks no CORS preflight of a read, and the call works
against an anonymous route whose CORS policy allows no request
headers. Natively it carries the User-Agent as every call does.