Use api to create comment got a 422 #2659

Closed
opened 2025-11-02 04:43:47 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @shark0119 on GitHub (Dec 14, 2018).

  • Gitea version (or commit ref):
    1.6.0 rc2
  • Git version:
    2.17.1
  • Operating system:
    Windows 10 Pro
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I try to use api to create a comment.
I know 422 is a parameter error. But I did it according to the documentation.
url: $MY_GITEA_URL/api/v1/repos/unary/greatrepo/issues/1/comments
parameter : { "body": "bbbbbb", "token": "MY_TOKEN"}
...

Screenshots

Request & Response

Originally created by @shark0119 on GitHub (Dec 14, 2018). - Gitea version (or commit ref): 1.6.0 rc2 - Git version: 2.17.1 - Operating system: Windows 10 Pro - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [ ] Not relevant - Log gist: ## Description I try to use api to create a comment. I know 422 is a parameter error. But I did it according to the [documentation](https://try.gitea.io/api/swagger). url: `$MY_GITEA_URL/api/v1/repos/unary/greatrepo/issues/1/comments` parameter : `{ "body": "bbbbbb", "token": "MY_TOKEN"}` ... ## Screenshots ![Request & Response](https://user-images.githubusercontent.com/17493206/49981582-874c4c80-ff93-11e8-8633-0d7ad51d283b.png)
Author
Owner

@shark0119 commented on GitHub (Dec 14, 2018):

a stupid mistake.. Need to put the body parameter in the body label

@shark0119 commented on GitHub (Dec 14, 2018): a stupid mistake.. Need to put the body parameter in the body label
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2659