stephanenicolas / robospice

Repo of the Open Source Android library : RoboSpice. RoboSpice is a modular android library that makes writing asynchronous long running tasks easy. It is specialized in network requests, supports caching and offers REST requests out-of-the box using extension modules.
Apache License 2.0
2.95k stars 545 forks source link

response headers missing? #464

Open or-dvir opened 7 years ago

or-dvir commented 7 years ago

Hi. i am using this library in conjunction with spring (using the class SpringAndroidSpiceRequest).

here is my load data from network:

@Override
    public T loadDataFromNetwork() throws Exception
    {
        HttpHeaders headers = new HttpHeaders();

        headers.add("Accept", "application/vnd.github.v3+json");

        headers.add("Authorization", User.getCurrentUserAuthenticationValue());

        if(mHttpMethod == HttpMethod.PUT)
        {
            headers.add("Content-Length", "0");
        }

        ResponseEntity<T> entity = getRestTemplate().exchange(mUrl, mHttpMethod, new HttpEntity<>(headers), mResponseType);

        mResponseHeaders = entity.getHeaders();

        return entity.getBody();
}

the problem is that for some reason mResponseHeaders is missing some headers, in particular one that is called "Link"

the header exists if i send the same request via web browser (using the DHC plugin):

4444444444444

am i doing something wrong? any ideas?

stephanenicolas commented 7 years ago

I think the problem comes from Spring Android. This library is quite obsolete as of today and you should probably look for a more modern one with a better support.

2016-11-23 0:04 GMT-08:00 Or Dvir notifications@github.com:

Hi. i am using this library in conjunction with spring (using the class SpringAndroidSpiceRequest).

here is my load data from network:

@Override public T loadDataFromNetwork() throws Exception { HttpHeaders headers = new HttpHeaders();

  headers.add("Accept", "application/vnd.github.v3+json");

  headers.add("Authorization", User.getCurrentUserAuthenticationValue());

  if(mHttpMethod == HttpMethod.PUT)
  {
      headers.add("Content-Length", "0");
  }

  ResponseEntity<T> entity = getRestTemplate().exchange(mUrl, mHttpMethod, new HttpEntity<>(headers), mResponseType);

  mResponseHeaders = entity.getHeaders();

  return entity.getBody();

}

the problem is that for some reason mResponseHeaders is missing some headers, in particular one that is called "Link"

the header exists if i send the same request via web browser (using the DHC plugin):

[image: 4444444444444] https://cloud.githubusercontent.com/assets/17179542/20554379/2c11a524-b164-11e6-8c2d-b27b61d90610.JPG

am i doing something wrong? any ideas?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stephanenicolas/robospice/issues/464, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33Xu-e52TiZcFA2KFUuJgatFcAfHaks5rA_OggaJpZM4K6Tkj .

or-dvir commented 7 years ago

@stephanenicolas any recommendations?

stephanenicolas commented 7 years ago

OkHttp is definitely the reference on Android.

2016-11-23 23:04 GMT-08:00 Or Dvir notifications@github.com:

@stephanenicolas https://github.com/stephanenicolas any recommendations?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stephanenicolas/robospice/issues/464#issuecomment-262704717, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33aoXY-orpTMWcNqI3StO3RHq1Bxfks5rBTcDgaJpZM4K6Tkj .

stephanenicolas commented 7 years ago

Retrofit is also very interesting. Explore the different extensions of RS. https://github.com/stephanenicolas/robospice/extensions

2016-11-24 3:01 GMT-08:00 Stéphane NICOLAS steff.nicolas@gmail.com:

OkHttp is definitely the reference on Android.

2016-11-23 23:04 GMT-08:00 Or Dvir notifications@github.com:

@stephanenicolas https://github.com/stephanenicolas any recommendations?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stephanenicolas/robospice/issues/464#issuecomment-262704717, or mute the thread https://github.com/notifications/unsubscribe-auth/ABv33aoXY-orpTMWcNqI3StO3RHq1Bxfks5rBTcDgaJpZM4K6Tkj .