https://github.com/nitindahiya-dev/get-request
Rust program that demonstrates making an HTTP GET request
https://github.com/nitindahiya-dev/get-request
get-request rust
Last synced: 24 days ago
JSON representation
Rust program that demonstrates making an HTTP GET request
- Host: GitHub
- URL: https://github.com/nitindahiya-dev/get-request
- Owner: nitindahiya-dev
- Created: 2024-07-02T09:28:07.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-02T09:32:46.000Z (almost 2 years ago)
- Last Synced: 2026-02-06T09:07:51.083Z (5 months ago)
- Topics: get-request, rust
- Language: Rust
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple HTTP Client in Rust with Error Handling
This repository contains a simple Rust program that demonstrates making an HTTP GET request using the `reqwest` crate, and handling potential errors using the `error_chain` crate.
## Features
## Prerequisites
## Usage
1. Clone the repository:
```sh
git clone https://github.com/your-username/rust-http-client.git
cd rust-http-client
```
2. Build the project:
```sh
cargo build
```
3. Run the project:
```sh
cargo run
```
## Code Explanation
The code uses the `error_chain` crate to manage errors and the `reqwest` crate to perform HTTP requests.
### Dependencies
Add the following dependencies to your `Cargo.toml` file:
```toml
[dependencies]
reqwest = { version = "0.11", features = ["blocking"] }
error-chain = "0.12.4"