mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Check that a POST actually finishes
This commit is contained in:
parent
a93eab8549
commit
4b5e342c89
1 changed files with 9 additions and 1 deletions
|
@ -98,7 +98,7 @@ resourceDidFailLoadingWithReason: (NSString *)reason
|
|||
NSURL *url;
|
||||
Class cls;
|
||||
|
||||
url = [NSURL URLWithString: @"http://www.gnustep.org/"];
|
||||
url = [NSURL URLWithString: @"https://www.w3.org/"];
|
||||
cls = [NSURLHandle URLHandleClassForURL: url];
|
||||
handle = [[cls alloc] initWithURL: url cached: NO];
|
||||
|
||||
|
@ -116,10 +116,18 @@ resourceDidFailLoadingWithReason: (NSString *)reason
|
|||
/* Don't get client messages in the foreground, so load in
|
||||
* background and wait a bit
|
||||
*/
|
||||
[handle writeProperty: @"POST" forKey: GSHTTPPropertyMethodKey];
|
||||
[handle writeData: [@"Hello" dataUsingEncoding: NSASCIIStringEncoding]];
|
||||
|
||||
[handle loadInBackground];
|
||||
PASS([self status] == URLHandleClientDidBeginLoading,
|
||||
"URLHandleResourceDidBeginLoading called");
|
||||
|
||||
[[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode
|
||||
beforeDate: [NSDate dateWithTimeIntervalSinceNow: 1.0]];
|
||||
PASS([self status] == URLHandleClientDidBeginLoading,
|
||||
"URLHandleResourceDidFinishLoading called");
|
||||
|
||||
[handle release];
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue