0

I am developping an iOS app that uses RestKit to make requests to my REST API. Since there are cases that could use a lot of data, I want to limit the data usage of my app. I could calculate the length of the data I post and the length of the data I receive, but this does not give me the overhead of these requests.

Is there a way to have the total amount of data used by my app?

Raphael Royer-Rivard
  • 2,252
  • 1
  • 30
  • 53

1 Answers1

1

There is no function which is keeping track of that right now but you can do that yourself in your app.

I recommend creating a singleton RestKit Interface class which does all of your network operations. Then all you have to do is before each request, you can use this call in RK

NSURLRequest *request = [self requestWithObject:object method:method path:path parameters:parameters];

Keep a static param in this class called myUsageStat and before making the request, increment myUsageStat by the size of request.HTTPBody (+ headers and url size if you care about those as well)

you will have to do the same for responses.

Hth

hackerinheels
  • 1,141
  • 1
  • 6
  • 14