Results 1 to 2 of 2

Thread: REST Response Size

Hybrid View

  1. #1

    Question REST Response Size

    As per my SO question here:

    What is the best way to go about measuring the size of the response when using RESTTemplate?

    I figure I'll have to count the bytes from the response somehow, but I'm not sure where to do that at.

    I'm already extending RESTTemplate to allow for GZip compression, so I figure there is just a method in there I can override, if it's not already built in.

    Most, if not all, of my requests are structured like so:

    Code:
    // Just applies app wide auth and SSL info, returns a GzipRestTemplate
    RestTemplate r = RestTemplateFactory.make( mContext );
    
    BaseModelListRequest jsonData = null;
    
    jsonData = r.getForObject( uri[0], BaseModelListRequest.class );
    And then later:

    Code:
    private LinkedHashMap< String, BaseModel[] > mObjects;
    
    mObjects = jsonData.getAllContent();
    If there is already a facility to do this, then I'm missing it in the docs, and if there isn't if someone could guide me as to what the most seamless insertion of such a function would be, I'd appreciate it very much.

  2. #2
    Join Date
    Nov 2010
    Posts
    175

    Default

    Currently, RestTemplate does not provide a mechanism for determining the download progress. We have an open feature request for adding this functionality [0] in a future release.

    [0] https://jira.springsource.org/browse/ANDROID-51
    Roy Clarkson
    Spring Mobile Projects Lead

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •