https://github.com/kevinsuner/bifrost
A simple HTTP/1.1 client written in Odin.
https://github.com/kevinsuner/bifrost
http http-client odin odin-lib
Last synced: 3 months ago
JSON representation
A simple HTTP/1.1 client written in Odin.
- Host: GitHub
- URL: https://github.com/kevinsuner/bifrost
- Owner: kevinsuner
- License: mit
- Created: 2025-05-10T15:37:34.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-10-04T20:52:38.000Z (6 months ago)
- Last Synced: 2025-10-04T22:24:34.471Z (6 months ago)
- Topics: http, http-client, odin, odin-lib
- Language: Odin
- Homepage:
- Size: 29.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bifrost
A simple HTTP/1.1 client written in Odin (besides the SSL stuff).
## Dependencies
The package depends on [OpenSSL](https://github.com/openssl/openssl) to make
HTTPS requests.
I've tested it on Linux (Mint 22.1), macOS (Sequoia 15.4) and Windows 11, the
first two had OpenSSL preinstalled, but you can get it through a package manager
usually as `libssl`.
For Windows, the repository itself contains a copy of these libraries.
## Example
```odin
package main
import "core:mem"
import "core:fmt"
import bifrost "../.." // Change the path.
main :: proc() {
buf := make([]u8, 8*mem.Kilobyte)
defer delete(buf)
arena: mem.Arena
mem.arena_init(&arena, buf)
defer mem.arena_free_all(&arena)
context.allocator = mem.arena_allocator(&arena)
url := bifrost.url_init()
defer bifrost.url_free(url)
err := bifrost.url_parse(url, "https://dummyjson.com/test")
if err != nil {
fmt.printf("url_parse failed: %v\n", err)
return
}
req := bifrost.request_init(.Get, url, nil)
defer bifrost.request_free(req)
err = bifrost.request_do(req)
if err != nil {
fmt.printf("request_do failed: %v\n", err)
return
}
fmt.printf("req.res: %v\n", req.res)
}
```