Hello, The 'forHTTPHeaderField' selector is mapped to the indexer of the NSMutableUrlRequest type, so
requestObj ["User_Agent"] = "Foobat/1.0"; should do what you want. Sebastien On Mon, Sep 12, 2011 at 10:46 AM, dotnet projects <coderproje...@gmail.com> wrote: > Hi, > I am trying to convert the following code to .Net > NSString *urlAddress = @"http://www.amazon.com"; > //Create a URL object. > NSURL *url = [NSURL URLWithString:urlAddress]; > //URL Requst Object > NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url]; > [requestObj setValue:@"Foobar/1.0" forHTTPHeaderField:@"User_Agent"]; > > > > > NSUrl url =new NSUrl(@"http://www.amazon.com"); > NSUrlRequest req = new NSUrlRequest(url); > req.SetValueForKey(???,"Foobar/1.0"); > > I don't know how to convert the following line > [requestObj setValue:@"Foobar/1.0" forHTTPHeaderField:@"User_Agent"] > > Is there any tutorial on converting Objective-C code to Mono? > Thanks > Art > _______________________________________________ > MonoTouch mailing list > MonoTouch@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/monotouch > > _______________________________________________ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch