pepsi
pepsi

Reputation: 6875

Changing HTTP User-Agent field in RestKit

The server that my app is connecting to only responds to certain user-agent values. I'm using NSURLConnection right now, which can do this. However, I'm thinking about switching to RestKit to simplify my code base.

Is there a way to change the HTTP User-Agent field in RestKit? Will additionalHTTPHeaders overwrite the default one?

Upvotes: 1

Views: 1296

Answers (1)

pepsi
pepsi

Reputation: 6875

This can be changed at the RKClient. The -setValue:forHTTPHeaderField: method can be used to overwrite the default User-Agent header.

I just tested this and confirmed that it works.

Upvotes: 7

Related Questions