Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

response headers missing? #464

Open
or-dvir opened this issue Nov 23, 2016 · 4 comments
Open

response headers missing? #464

or-dvir opened this issue Nov 23, 2016 · 4 comments

Comments

@or-dvir
Copy link

or-dvir commented Nov 23, 2016

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
Copy link
Owner

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 [email protected]:

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
#464, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ABv33Xu-e52TiZcFA2KFUuJgatFcAfHaks5rA_OggaJpZM4K6Tkj
.

@or-dvir
Copy link
Author

or-dvir commented Nov 24, 2016

@stephanenicolas any recommendations?

@stephanenicolas
Copy link
Owner

stephanenicolas commented Nov 24, 2016 via email

@stephanenicolas
Copy link
Owner

stephanenicolas commented Nov 24, 2016 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants