"Update a file" API

I want to use update-a-file API to update a file from a Pull Request of my own repo. I have used a effective token,and I can edit the head branch of this PR witch forked from my repo,  but I still got an “Not Found”. 

PUT /repos/:owner<font color="#FF6600">(<span class="s2">pull.</span>head.repo.name)</font>/:repo<font color="#FF6600">(<span class="s2">pull.</span>head.repo.owner.login)</font>/contents/:path<font color="#FF6600">(<span class="s2">pull.files[0].</span>filename)</font>

Authorization: token<font color="#FF6600">personal-access-token</font>

{"message":"my commit message","content":"bXkgdXBkYXRlZCBmaWxlIGNvbnRlbnRz","sha":"329688480d39049927147c162b9d2deaf885005f"<font color="#FF6600">(pull.files[0].sha)</font>}

sure the “maintainer_can_modify” is true; The repository is a public repository and I am the maintainer;and I have write access to the head,because I try to edit it on the web,it work.

If the second code block in your post is the body that you’re submitting, it appears that you left out the branch name? If you’re attempting to update a PR, I assume that the file that you’re wanting to update isn’t on the master branch?

If I’m incorrect, can you supply a minimal set of steps to reproduce the problem in a public repository so that we can take a closer look?

thanks for your reply,here is my steps:

  1. My username is sunui,I have a repo :https://github.com/sunui/for-robot-test

  2. Sun-Xinlei forked my repo: https://github.com/Sun-Xinlei/for-robot-test

3.He update something on his branch patch-1 and send a PR to my repo from  Sun-Xinlei:patch-1 https://github.com/sunui/for-robot-test/pull/17

4.I want to edit something on this PR,I can do this on the web by Committing directly to the Sun-Xinlei:patch-1 branch.https://github.com/sunui/for-robot-test/pull/17/commits

5.Now I want todo this through API :https://developer.github.com/v3/repos/contents/#create-or-update-a-file。

I put a json to https://api.github.com/repos/Sun-Xinlei/for-robot-test/contents/TODO1/introducing-constraint-layout-1-1.md

I got 404 “not found”