34 lines
749 B
Markdown
34 lines
749 B
Markdown
|
|
|
|
```rust
|
|
let response = fetch(
|
|
"https://hatter.ink/util/print_request.action",
|
|
&FetchOptions::default())?;
|
|
```
|
|
|
|
```rust
|
|
let response = fetch(
|
|
"https://hatter.ink/util/print_request.action",
|
|
&FetchOptions {
|
|
method: FetchMethod::Put,
|
|
body: Some("{}".as_bytes().to_vec()),
|
|
..Default::default()
|
|
})?;
|
|
```
|
|
|
|
|
|
```rust
|
|
let response = fetch(
|
|
"https://hatter.ink/util/print_request.action",
|
|
&FetchOptions {
|
|
method: FetchMethod::Post,
|
|
headers: vec![
|
|
FetchHeader {
|
|
key: "content-type".to_string(),
|
|
value: "application/json".to_string(),
|
|
}
|
|
],
|
|
body: Some("{}".as_bytes().to_vec()),
|
|
..Default::default()
|
|
})?;
|
|
``` |