Hi Andreas, Am 13.08.2013 um 15:52 schrieb Andreas Höschler:
> Hi all, > > I need an Objective-C (GNUstep) wrapper for accessing the OpenStreetMap API, > basically an Objective-C replacement for > > curl -v -H 'Authorization: Basic bXl1c2VybmFtZTpteXBhc3N3b3Jk' > 'http://api.openstreetmap.org/path' > > I do successfully access the API for read only calls that do not require > authentication like so > > #define IPADDRESS @"api.openstreetmap.org" > > SRFileHandle *handle = [[SRFileHandle alloc] > initAsClientAtAddress:IPADDRESS port:80]; > NSString *request = @"GET /api/capabilities\n"; > [handle writeData:[request dataUsingEncoding:NSUTF8StringEncoding]]; > NSData *data = [handle readDataToEndOfFile]; > NSString *xmlString = [[NSString alloc] initWithData:data > encoding:NSUTF8StringEncoding]; > [handle closeFile]; > [handle release]; > > NSLog(@"xmlString: %@", xmlString); > > Any idea how this could be extended to include Basic HTTP Authentication for > PUT calls like > > PUT /api/0.6/changeset/create > > Googling got me lots of NSURL, addRequestHeader,... stuff, but I don't have > all these fancy new classes in my (rather old) GNUstep tree. Anyone? Your tree must be really old. I think I did write some NSURLConnection stuff more than 5 years ago and Richard did integrate, test and update it in Base also for several years. BR, Nikolaus
_______________________________________________ Discuss-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
