Losing a / when converting from NSURL to NSURLRequest

后端 未结 3 1735
傲寒
傲寒 2021-01-02 08:22

I\'m doing an HTTP Post in my iphone app and one of the parameters I send to the server is a URL. The problem is that when I convert from an NSURL to an NSURLRequest, the st

3条回答
  •  清歌不尽
    2021-01-02 09:05

    EDIT 1 I was getting the problem as described. But missed it in my output. (hence the down vote :-( ) So have removed the code I put up as an answer.

    *Edit 2

    But related to my comments here is some code apple use to get a NSURLRequest,

    NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com/"]
                        cachePolicy:NSURLRequestUseProtocolCachePolicy
                    timeoutInterval:60.0];      
    

    @Dave DeLong: I notice in the Apple "URL Loading System Program Guide" the example creating a connection and request does not use any escaping. The Url it uses is from a NSURL URLWithString:

提交回复
热议问题