cc-haxe/src/kernel/http/HTTPResponse.hx

18 lines
382 B
Haxe
Raw Normal View History

2022-03-04 19:00:41 +00:00
package kernel.http;
using lua.Table;
class HTTPResponse {
public final statusCode:StatusCode;
public final headers:Map<String,String>;
public final body:String;
@:allow(kernel.http)
private function new(handle: cc.HTTP.HTTPResponse) {
this.statusCode = handle.getResponseCode();
this.headers = handle.getResponseHeaders().toMap();
this.body = handle.readAll();
}
}