-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
response data 가 nil 로 반환됩니다 #4
Comments
clayful gem 에서 사용중인 rest-client gem 의 2.1.0 버전에, 이슈 코멘트에 언급된데로 결론적으로 아래와 같이 사용하면 작동이 됩니다. Clayful.config['Authorization'] = '클라이언트키'
Clayful.config['Accept-Encoding'] = '*'
Clayful::Collection.count
=> #<Clayful::Response:0x00007fcf9afb65a0
@data={"count"=>{"raw"=>148, "formatted"=>"148", "converted"=>"148"}},
@headers=
{:accept_ranges=>"bytes",
:access_control_allow_credentials=>"true",
:access_control_expose_headers=>
"WWW-Authenticate,Server-Authorization,content-currency,content-time-zone",
:cache_control=>"no-cache",
:content_currency=>"KRW",
:content_language=>"ko",
:content_time_zone=>"Asia/Seoul",
:content_type=>"application/json; charset=utf-8",
:date=>"Wed, 22 Apr 2020 11:26:06 GMT",
:server=>"nginx/1.14.1",
:vary=>"origin,accept-encoding",
:content_length=>"57",
:connection=>"keep-alive"},
@status=200>
Clayful::Collection.count.data
=> {"count"=>{"raw"=>148, "formatted"=>"148", "converted"=>"148"}} 아니면 rest-client gem 2.1.0 버전에만 해당 이슈가 있어 보이므로, s.add_runtime_dependency 'rest-client', '~> 2.0.1' |
말씀해주신 대로 2.1.0으로 업그레이드를 진행하고 디코딩 문제를 해결하거나, 2.0.1 버전으로 고정하는 방법을 감안해봐야할 것 같습니다. 내부적으로 한번 검토해보고 패칭 진행하도록 하겠습니다. 이슈 남겨주셔서 감사합니다! |
- 테스트 디펜던시 `fakeweb` 동작이 깨지던 부분을 `fakeweb-fi` 모듈로 마이그레이션 (chrisk/fakeweb#57 (comment)) - `rest-client` `2.1>=` 버전에서 `gzip` `Accept-Encoding` 헤더를 제대로 처리하지 못해 반환 데이터가 제대로 잡히지 않던 현상 수정 (#4)
@say8425 리포트해주신 이슈 관련하여 수정된
|
안녕하세요. 어떻게 사용해야할지 모르겠어서, 직접 라이브러리 코드를 뜯어서 사용했습니다.
그런데 제가 올바르게 사용했는지 모르겠어서 이슈 남겨드립니다.
client 로 client 키를 넘겨주면 될거라 생각하고 했는데, 에러가 발생했습니다.
그래서 코드를 보니까 client 가 최종적으로 Authorization 으로 넘겨주는 것을 발견하고,
Authorization 에 직접 client 키르 넘겨줬습니다.
이렇게 하니까 200 OK 가 떨어졌지만, data 가 nil 을 반환하였습니다.
혹시 잘못 호출한 코드나 있나요?
고맙습니다.
The text was updated successfully, but these errors were encountered: