Skip to content

[API] janken #2

Description

@Yosh8g

エンドポイント

/janken

HTTPメソッド

POST(新しいデータを作る)

このエンドポイントの概要

Request: ユーザの手を送る
Response: cpuの手と勝ち負けの結果を受け取る

パスパラメータ(URLに含まれる値)

なし

クエリパラメータ(?以降のパラメータ)

なし

リクエストボディ(POSTやPUTで送るデータ)

// リクエストボディの構造体
type PlayGameRequest struct {
	UserHand string `json:"user_hand"` // "rock", "scissors", "paper"
}

レスポンスボディ(APIが返すデータ)

// 200 OK: 成功時のレスポンス
type PlayGameResponse struct {
	Result string `json:"result"`    // "win", "lose", "draw"
        CPUHand string `json:"cpu_hand"` // "rock", "scissors", "paper"
}

ステータスコード一覧

ステータスコード 説明
200 ok

リクエスト・レスポンスの例

備考・補足

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions