我需要發送請求到我的服務器沒有http頭與NSMutableURLRequest和NSMutableURLConnection。我發現這刪除標題[request setValue:@"" forHTTPHeaderField:@"User-Agent"];
的內容,但我需要刪除所有標題。 現在:刪除NSMutableURLRequest中的HTTP標頭
GET/HTTP/1.1
Host: 127.0.0.1:5555
Accept: */*
Accept-Language: en-us
Connection: keep-alive
Accept-Encoding: gzip, deflate
User-Agent:
極品:
Custom text like "Hello"
代碼:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
爲什麼?我不知道你可以像一些標頭內置... – Wain 2015-02-07 10:29:19
@是的,你確定嗎?我需要客戶端和服務器之間的清晰對話。 – Vladislav 2015-02-07 10:38:06
您的服務器?不是服務器應該關心用戶代理... – Wain 2015-02-07 18:57:26