@@ -38,10 +38,15 @@ @implementation OFHTTPRequest + request { return [[[self alloc] init] autorelease]; } + ++ requestWithURL: (OFURL*)url +{ + return [[[self alloc] initWithURL: url] autorelease]; +} - init { self = [super init]; @@ -48,10 +53,24 @@ requestType = OF_HTTP_REQUEST_TYPE_GET; headers = [[OFDictionary alloc] initWithObject: @"Something using ObjFW " @"" forKey: @"User-Agent"]; + + return self; +} + +- initWithURL: (OFURL*)url +{ + self = [self init]; + + @try { + [self setURL: url]; + } @catch (id e) { + [self release]; + @throw e; + } return self; } - (void)dealloc