node-github

Decoding base64 while using GitHub API to Download a File

守給你的承諾、 提交于 2019-12-10 11:23:01
问题 I am using the GitHub API to download a file from GitHub. I have been able to successfully authenticate as well as get a response from github, and see a base64 encoded string representing the file contents. Unfortunately, I get an unusual error (string length is not a multiple of 4) when decoding the base64 string. The HTTP request is illustrated below: GET /repos/:owner/:repo/contents/:path The (partial) response is illustrated below: { "name":...., "download_url":...", "type":"file",

Decoding base64 while using GitHub API to Download a File

天大地大妈咪最大 提交于 2019-12-06 11:03:48
I am using the GitHub API to download a file from GitHub. I have been able to successfully authenticate as well as get a response from github, and see a base64 encoded string representing the file contents. Unfortunately, I get an unusual error (string length is not a multiple of 4) when decoding the base64 string. The HTTP request is illustrated below: GET /repos/:owner/:repo/contents/:path The (partial) response is illustrated below: { "name":...., "download_url":...", "type":"file", "content":"ewogICAgInN3YWdnZXIiOiAiM... } The issue I am encountering is that the length of the string is