https://github.com/thatstoasty/floki
Simple socket wrapper and http client for Mojo
https://github.com/thatstoasty/floki
http-client mojo socket
Last synced: 17 days ago
JSON representation
Simple socket wrapper and http client for Mojo
- Host: GitHub
- URL: https://github.com/thatstoasty/floki
- Owner: thatstoasty
- License: mit
- Created: 2024-02-06T18:28:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-11T22:42:18.000Z (3 months ago)
- Last Synced: 2025-07-12T00:26:05.444Z (3 months ago)
- Topics: http-client, mojo, socket
- Language: Mojo
- Homepage:
- Size: 204 KB
- Stars: 18
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mojo-max-mlir - thatstoasty/mojo-http-client - http-client?style=social"/> : Simple socket wrapper and http client for Mojo. (HTTP Framework)
- awesome-mojo-max-mlir - thatstoasty/mojo-http-client - http-client?style=social"/> : Simple socket wrapper and http client for Mojo. (HTTP Framework)
README
# floki

A barebones HTTP/1.1 client for Mojo using only Mojo and external C calls.
Please check out the `src/test.mojo` for an example of how to use the client for now. I will add documentation later.
```mojo
from floki.session import Session, TCPConnectionfn main() raises -> None:
var client = Session()
var response = client.post(
"http://jsonplaceholder.typicode.com/todos",
{"Content-Type": "application/json"},
data={"key1": "value1", "key2": "value2"},
)
print("POST Response Status Code:", response.status_code)
for pair in response.body.as_dict().items():
print(pair.key, ":", pair.value)
```