Skip to content

Commit

Permalink
http library test
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaStev committed Nov 12, 2024
1 parent ad553f5 commit f71271c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions library/http/test/main.wave
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
import("http");

fun main() {
var response = send_get("https://example.com");
println("GET Request Status Code: {}", response.status_code);
println("GET Request Body: {}", response.body);

var post_body = "{ \"name\": \"Wave\", \"type\": \"library\" }";
var post_response = send_post("https://expample.com/api", post_body);
println("POST Request Status Code: {}", post_response.status_code);
println("POST Request Body: {}", post_response.body);
}

0 comments on commit f71271c

Please sign in to comment.