# Raw URL works in browser but not programmatically

**URL:** <https://forum.gitea.com/t/raw-url-works-in-browser-but-not-programmatically/632>\
**Category:** General\
**Created:** [October 19, 2018, 12:17pm UTC](https://forum.gitea.com/t/raw-url-works-in-browser-but-not-programmatically/632 "2018-10-19T12:17:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gflorent](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gflorent](https://forum.gitea.com/u/gflorent)\
**Post date:** [October 19, 2018, 12:17pm UTC](https://forum.gitea.com/t/raw-url-works-in-browser-but-not-programmatically/632/1 "2018-10-19T12:17:21Z")

</div>

I have a locally installed gitea instance. It has a ‘gflorent’ user that has 1 repo: ‘test-repo’. In this repo, on master, I have a file ‘as1\_pe\_203.stp’.  
In a browser, the url [http://localhost:3000/gflorent/test-repo/raw/branch/master/as1\_pe\_203.stp](http://localhost:3000/gflorent/test-repo/raw/branch/master/as1_pe_203.stp) has the file contents displayed without problem.  
But if I try to get the file contents from a program (Python requests, subprocess call to wget, or even wget from command line …), I always face a 404 error.  
Are there some settings in Gitea to filter requests based on request headers/origin? Or a completely different explanation?

---

<div class="post-metadata">

**Author:** ![Herschel](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@Herschel](https://forum.gitea.com/u/Herschel)\
**Post date:** [October 20, 2018, 8:41pm UTC](https://forum.gitea.com/t/raw-url-works-in-browser-but-not-programmatically/632/2 "2018-10-20T20:41:13Z")

</div>

Is it a private repository?

---

<div class="post-metadata">

**Author:** ![gflorent](https://avatars.discourse-cdn.com/v4/letter/g/71e660/32.png) [@gflorent](https://forum.gitea.com/u/gflorent)\
**Post date:** [October 20, 2018, 9:16pm UTC](https://forum.gitea.com/t/raw-url-works-in-browser-but-not-programmatically/632/3 "2018-10-20T21:16:10Z")

</div>

Yes. And setting it to public solves the problem. Big thanks !!  
Do you know how to retrieve a file from a private repo programmatically? Build the login request? But how to retrieve the password?

---

<div class="post-metadata">

**Author:** ![Herschel](https://avatars.discourse-cdn.com/v4/letter/h/ecd19e/32.png) [@Herschel](https://forum.gitea.com/u/Herschel)\
**Post date:** [October 21, 2018, 8:16am UTC](https://forum.gitea.com/t/raw-url-works-in-browser-but-not-programmatically/632/4 "2018-10-21T08:16:17Z")

</div>

I have no experience with it but there does seem to be an API [https://docs.gitea.io/en-us/api-usage/](https://docs.gitea.io/en-us/api-usage/)
