Struct line_bot_sdk_rust::client::HttpClient[][src]

pub struct HttpClient { /* fields omitted */ }

Implementations

impl HttpClient[src]

pub fn new(channel_token: &str) -> HttpClient[src]

Note

Instantiate a HttpClient.

let http_client = HttpClient::new("<channel secret>");

pub fn get(
    &self,
    endpoint: &str,
    query: Vec<(&str, &str)>,
    data: Value
) -> Result<Response, Error>
[src]

Note

GET request

let res: Result<Response, Error> = http_client.get("https://example.com");

pub fn post(&self, endpoint: &str, data: Value) -> Result<Response, Error>[src]

Note

POST request

let res: Result<Response, Error> = http_client.post("https://example.com");

pub fn put(&self, endpoint: &str, data: Value) -> Result<Response, Error>[src]

Note

PUT request

let res: Result<Response, Error> = http_client.put("https://example.com");

pub fn delete(&self, endpoint: &str, data: Value) -> Result<Response, Error>[src]

Note

DELETE request

let res: Result<Response, Error> = http_client.delete("https://example.com");

Trait Implementations

impl Debug for HttpClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.