philschatz / octokat.js

:octocat: Github API Client using Promises or callbacks. Intended for the browser or NodeJS.
http://philschatz.com/2014/05/25/octokat/
MIT License
421 stars 133 forks source link

Valid url produces error when containing slashes #187

Open mokkabonna opened 7 years ago

mokkabonna commented 7 years ago

I use

octo.fromUrl('http://api.github.com/repos/octocat/Hello-World/git/refs{/sha}', {
  sha: 'heads/master'
})

But get an error saying sha can't contain slashes. But how else am I going to create the url http://api.github.com/repos/octocat/Hello-World/git/refs/heads/master ?

Now I have to manually create the url to get around this.