Reputation: 35
I try to synchronise local data with server. Is it possible to use get "if-Modified-Since" request in IOS?
If-Modified-Since = "If-Modified-Since" ":" HTTP-date
Upvotes: 2
Views: 1915
Reputation: 45598
You can set HTTP fields with an NSMutableURLRequest
:
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setValue:@"Your string" forHTTPHeaderField:@"If-Modified-Since"];
// ...
You can then check the status code of the response and look specifically for 304
(Not Modified).
Upvotes: 5