# \[solved\] Downloading single file from repo using Curl and authentication withToken

**URL:** <https://forum.gitea.com/t/solved-downloading-single-file-from-repo-using-curl-and-authentication-withtoken/7083>\
**Category:** Gitea Usages\
**Created:** [April 14, 2023, 2:22pm UTC](https://forum.gitea.com/t/solved-downloading-single-file-from-repo-using-curl-and-authentication-withtoken/7083 "2023-04-14T14:22:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmonty14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/cmonty14/32/1627_2.png) [@cmonty14](https://forum.gitea.com/u/cmonty14)\
**Post date:** [April 14, 2023, 2:22pm UTC](https://forum.gitea.com/t/solved-downloading-single-file-from-repo-using-curl-and-authentication-withtoken/7083/1 "2023-04-14T14:22:34Z")

</div>

Hello,

I’m trying to download a single file from a repo using Curl and authentication Token.  
Using this command results in downloaded file contains metadata in JSON format:

```auto
curl -k "https://git.example.com/api/v1/repos/org/scripts/contents/file.sh" -H "accept: application/json" -H "Authorization: token 975906fcxxxxxxxxxxxxxxxxxxxxxxxx"
 -o file.sh

```

I don’t think `-H "accept: application/json"` is correct here.

Can you please advise which curl syntax will download file.sh correctly?

THX

* * *

Update: this command works as expected  
`curl -k "https://git.example.com/api/v1/repos/org/scripts/raw/file.sh" -H "accept: application/raw" -H "Authorization: token <TOKEN>" -o [file.sh](http://file.sh/)`
