You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RequestError: invalid json response body at https://api.github.com/gists/abczyz123 reason: Unexpected end of JSON input
The first call (res1) seems to work fine, but in the second call, I added headers If-None-Match returned the above output. Most likely I'm doing something wrong here but I cannot find out where is the error.
Thank you in advance and best regards
Would you be interested in contributing a fix?
yes
The text was updated successfully, but these errors were encountered:
Hi @Chocrates
Thank you for your response. I will try to test follow your recommendation soon.
Just one thing, actually I implemented the same way with the personal access token (not anonymous) and it's working fine. So I'm not sure if the stringify caused the problem
Please avoid duplicates
Reproducible test case
https://runkit.com/g-hoang/octokit-rest-js-2169
Please select the environment(s) that are relevant to your bug report
Version
+-- @octokit/auth-app@3.6.0
| +-- @octokit/auth-oauth-app@4.3.0
| | +-- @octokit/auth-oauth-device@3.1.2
| +-- @octokit/auth-oauth-user@1.3.0
| | +-- @octokit/oauth-methods@1.2.4
| | | +-- @octokit/oauth-authorization-url@4.3.3
| +-- @octokit/request@5.6.1
| | +-- @octokit/endpoint@6.0.12
| +-- @octokit/request-error@2.1.0
| +-- @octokit/types@6.27.1
| |
-- @octokit/openapi-types@10.1.4 +-- @octokit/plugin-retry@3.0.9 +-- @octokit/plugin-throttling@3.5.2 +-- @octokit/rest@18.10.0 | +-- @octokit/core@3.5.1 | | +-- @octokit/auth-token@2.4.5 | | +-- @octokit/graphql@4.8.0 | +-- @octokit/plugin-paginate-rest@2.16.1 | +-- @octokit/plugin-request-log@1.0.4 |
-- @octokit/plugin-rest-endpoint-methods@5.10.2What happened?
Hi,
I'm trying to cache one of my requests using conditional request with etag. All the calls are anonymous. Here is my code in the test case:
Output:
RequestError: invalid json response body at https://api.github.com/gists/abczyz123 reason: Unexpected end of JSON input
The first call (res1) seems to work fine, but in the second call, I added headers
If-None-Match
returned the above output. Most likely I'm doing something wrong here but I cannot find out where is the error.Thank you in advance and best regards
Would you be interested in contributing a fix?
The text was updated successfully, but these errors were encountered: