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
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
Yes
Thank you
Art
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/seting-UIWebview-user-agent-objectiveC-question-tp3807602p3807638.html
Sent from the MonoTouch mailing list archive at Nabble.com.
___
MonoTouch mailing list
Hi
I tried it and getting the following
Error CS0200: Property or indexer
`MonoTouch.Foundation.NSUrlRequest.this[string]' cannot be assigned to (it
is read-only)
I am trying to convert the code in the following URL
Hey,
The original (objectivec) code was using NSMutableUrlRequest, not
NSUrlRequest (it was also part of my previous answer ;-). FWIW you
cannot change it if it's not mutable.
Sebastien
On Mon, Sep 12, 2011 at 11:20 AM, coderprojects coderproje...@gmail.com wrote:
Hi
I tried it and getting
I missed the NSMutableUrlRequest
NSMutableUrlRequest req = new NSMutableUrlRequest(url1);
req[User_Agent] =Mozilla/5.0
(Windows; U; Windows NT 6.0; en-US)
AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.38 Safari/532.0;
That worked.
Thanks
Thats a gotcha for new players (and old ones)
Anything in Cocoa which isn't NSMutable is NOT Mutable (it can't
be mutated - changed, altered etc)
And, generally, if there is a NS, there is an NSMutable as
well, if it makes sense to change it.
On Mon, Sep 12, 2011 at 16:59,