Add [Navi](https://navi-lang.org) language for example to external language for CodeEditor. <img width="864" alt="image" src="https://github.com/user-attachments/assets/73afa56d-31bd-4867-a9f2-0a8cf790af0f" />
18 lines
433 B
Text
18 lines
433 B
Text
use std.net.http.client.{HttpClient, Request};
|
|
use std.net.http.OK;
|
|
|
|
fn main() throws {
|
|
let client = HttpClient.new(
|
|
max_redirect_count: 5,
|
|
user_agent: "navi-client",
|
|
);
|
|
let req = try Request.get("https://httpbin.org/get");
|
|
let res = try client.request(req);
|
|
|
|
if (res.status() != OK) {
|
|
try println("Failed to fetch repo", res.text());
|
|
return;
|
|
}
|
|
|
|
try println(res.text());
|
|
}
|