# PUT request for modify file

**URL:** <https://forum.gitea.com/t/put-request-for-modify-file/2020>\
**Category:** General\
**Created:** [March 22, 2020, 7:09pm UTC](https://forum.gitea.com/t/put-request-for-modify-file/2020 "2020-03-22T19:09:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![claudius108](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/claudius108/32/4908_2.png) [@claudius108](https://forum.gitea.com/u/claudius108)\
**Post date:** [March 22, 2020, 7:09pm UTC](https://forum.gitea.com/t/put-request-for-modify-file/2020/1 "2020-03-22T19:09:31Z")

</div>

Hi,

I am using the below CURL command to update a file in gitea, but it looks stalled. The same behaviour is in javascript with XMLHttpRequest and with fetch(), I got no answer, nothing:

curl -v -X PUT “path-to-host-and-file” -H “accept: application/json” -H “Content-Type: application/json” -H “Authorization: token …” -d ‘{“content”:“content in base64 format”,“message”:“Updated file uuid-74f5ca75-7022-4c7c-b5ca-7570225c7c55”,“author”:{“email”:“email”,“name”:“name”}}’ -i

- Trying host…
- TCP\_NODELAY set
- Connected to host (host) port 3000 (#0)

> PUT /api/v1/repos/path-to-file HTTP/1.1  
> Host: host:3000  
> User-Agent: curl/7.58.0  
> accept: application/json  
> Content-Type: application/json  
> Authorization: token …  
> Content-Length: 6340  
> Expect: 100-continue

\< HTTP/1.1 100 Continue  
HTTP/1.1 100 Continue

- We are completely uploaded and fine

Thanks,  
Claudius

---

<div class="post-metadata">

**Author:** ![claudius108](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/claudius108/32/4908_2.png) [@claudius108](https://forum.gitea.com/u/claudius108)\
**Post date:** [March 24, 2020, 9:33pm UTC](https://forum.gitea.com/t/put-request-for-modify-file/2020/2 "2020-03-24T21:33:02Z")

</div>

Shortly, I am not getting response 200 and the response as in swagger:  
{  
“commit”: {  
“author”: {  
“date”: “string”,  
“email”: “…”,  
“name”: “string”  
},  
“committer”: {  
“date”: “string”,  
“email”: “…”,  
“name”: “string”  
},  
“html\_url”: “string”,  
“message”: “string”,  
“parents”: [  
{  
“sha”: “string”,  
“url”: “string”  
}  
],  
“sha”: “string”,  
“tree”: {  
“sha”: “string”,  
“url”: “string”  
},  
“url”: “string”  
},  
“content”: {  
“\_links”: {  
“git”: “string”,  
“html”: “string”,  
“self”: “string”  
},  
“content”: “string”,  
“download\_url”: “string”,  
“encoding”: “string”,  
“git\_url”: “string”,  
“html\_url”: “string”,  
“name”: “string”,  
“path”: “string”,  
“sha”: “string”,  
“size”: 0,  
“submodule\_git\_url”: “string”,  
“target”: “string”,  
“type”: “string”,  
“url”: “string”  
},  
“verification”: {  
“payload”: “string”,  
“reason”: “string”,  
“signature”: “string”,  
“signer”: {  
“email”: “[user@example.com](mailto:user@example.com)”,  
“name”: “string”,  
“username”: “string”  
},  
“verified”: true  
}  
}

Any ideas?

Thanks,  
Claudius
