文件名称:FakeHTTP:用于iOS测试的简单HTTP模拟
文件大小:316KB
文件格式:ZIP
更新时间:2024-05-19 07:23:17
Objective-C
适用于iOS的简单HTTP模拟 开始模拟HTTP连接 [FakeHTTP startMocking]; 模拟网址请求 NSURL *url = [NSURL URLWithString:@"http://example.com/foo"]; NSData *bodyData = [@"hello" dataUsingEncoding:NSUTF8StringEncoding]; NSDictionary *headers = [NSDictionary dictionaryWithObject:@"bar" forKey:@"foo"]; FakeHTTPURLResponse *response = [[FakeHTTPURLResponse alloc] initWithStatusCode:200 headers:headers body:data]; [FakeH