'GET /repos/:owner/:repo/contents/:path
https://developer.github.com/v3/repos/contents/#get-contents'

def contents(self, request):

    response = {'status': (-1)}
    response['fileType'] = filetype = request.GET.get('fileType', 'dir')
    filepath = request.GET.get('path', '/')
    filepath = self._clean_path(filepath)
    if self._remote_url:
        (owner, repo, branch) = self.parse_github_url(self._remote_url)
        blob = self._get_contents(owner, repo, filepath)
        if (filetype == 'dir'):
            response['files'] = _massage_content(blob)
            response['status'] = 0
        elif (filetype == 'file'):
            try:
                response['content'] = blob['content'].decode('base64')
                response['status'] = 0
            except binascii.Error as e:
                raise GithubClientException(('Failed    to    decode    file    contents,    check    if    file    content    is    properly    base64-encoded:    %s' % e))
            except KeyError as e:
                raise GithubClientException(('Failed    to    find    expected    content    object    in    blob    object:    %s' % e))
    else:
        return HttpResponseBadRequest(_('url    param    is    required'))
    return JsonResponse(response)
