diff --git a/.aspect/axl.axl b/.aspect/axl.axl index fe9714402..9222ad7f1 100644 --- a/.aspect/axl.axl +++ b/.aspect/axl.axl @@ -417,6 +417,23 @@ def test_http(ctx: TaskContext, tc: int, temp_dir: str) -> int: return tc +def test_http_get_post(ctx: TaskContext, tc: int, temp_dir: str) -> int: + # Test HTTP get and post methods including unix_socket support + + # Test 1: Basic HTTP GET request (reuse same URL as download test) + url = "https://raw.githubusercontent.com/aspect-build/aspect-cli/refs/heads/main/LICENSE" + resp1 = ctx.http().get(url = url).block() + tc = test_case(tc, resp1.status == 200, "http.get should return status 200") + tc = test_case(tc, "Apache License" in resp1.body, "http.get body should contain Apache License text") + tc = test_case(tc, type(resp1.headers) == "list", "http.get headers should be a list") + tc = test_case(tc, len(resp1.headers) > 0, "http.get headers should not be empty") + + # Test 2: HTTP GET with custom headers + resp2 = ctx.http().get(url = url, headers = {"User-Agent": "AXL-Test"}).block() + tc = test_case(tc, resp2.status == 200, "http.get with custom headers should return status 200") + + return tc + def impl(ctx: TaskContext) -> int: tc = 0 @@ -464,6 +481,7 @@ def impl(ctx: TaskContext) -> int: tc = test_large_bes(ctx, tc, temp_dir) tc = test_http(ctx, tc, temp_dir) tc = test_bazel_info(ctx, tc) + tc = test_http_get_post(ctx, tc, temp_dir) print(tc, "tests passed") return 0