跳到主要内容

Create New File

POST 

/api/v5/repos/:owner/:repo/contents/:path

Request​

Path Parameters

    owner stringrequired

    Repository space address (organization or individual's address path)

    repo stringrequired

    Repository path (path)

    path stringrequired

    File path

Query Parameters

    access_token stringrequired

    User authorization code

Body

    contentstringrequired

    File content to be base64 encoded

    messagestringrequired

    The commit message for the submitted commit.

    branchstring

    The submitted branch

    author[name]string

    Author's name, defaults to the current user's name

    author[email]string

    Author's email, defaults to the current user's email.

Responses​

Successful Response

Response Headers
    Schema
      commit object
      shastring
      author object
      namestring
      emailstring
      datestring
      committer object
      namestring
      emailstring
      datestring
      messagestring
      parents object[]
    • Array [
    • shastring
    • ]