Files
oraset/examples/test_with_response.oraset
T
2026-04-24 21:54:58 +08:00

15 lines
470 B
Plaintext

// 测试包含response模块后使用HTTP请求函数
// 包含response模块
!include 'response'
// 测试HTTP GET请求
response = http_get(`http://example.com`);
show(`HTTP GET response length: `, len(response));
show(`First 100 characters: `, substring(response, 0, 100));
// 测试HTTP POST请求
post_data = `{"name": "Oraset", "version": "1.0"}`;
post_response = http_post(`http://httpbin.org/post`, post_data);
show(`\nHTTP POST response: `, post_response);