[Spring]Posman-POSTの使用
POSTのプリセット設定を使用
POST
方式は、APIキー値が受信された場合にのみ使用できます.
+
をクリックしてコレクションを追加し、Request name
:Submit an order、saveをクリックします.同様に
Request name
:API AUTHを作成
https://github.com/vdespa/introduction-to-postman-course/blob/main/simple-books-api.md

API authではGETではなく
POST
として指定{{baseUrl}}/api-clients
を入力し、Bodyのraw
をクリックします.
JSON
をクリックしてtextではなく
{
"clientName" : "Dingdoooo",
"clientEmail" : "[email protected]"
}

コードclientName、clientEmailヒープデータを
Body
セクションに挿入し、「Send」をクリックします.
応答部作成
accessToken
、ステータス:201作成(APIでPOST方式でトークン値を取得)

Collections-
Simple books API
のEdit
クリック
[
Variables
]をクリックします.
Variable=
accessToken
;初期値=トークン値の入力注意:変数は
ctrl + s
に保存されます!!✨ 🥫 Submit an order collection

Bodyのnoneを
raw
として選択
選択text
JSON

bookId、customerNameデータの入力
権限の追加
Paramsの横にある
Authorization
をクリックします.
[
Bearer Token
]をクリックします.
入力
{{accessToekn}}

非表示クリック
Headers

認証登録が正しい.

sendクリック、作成、order生成
Get All orders collection

collection
+
を追加し、「Save as」をクリックします.
Request name
:Get All orders入力後Save

APIにアクセスする権限を追加する必要があります.
パラメータの横にある
Auth
をクリックし、タイプBearer Token
をクリックします.
Tokenに
{{accessToken}}
と入力
{{baseUrl}}/orders
と入力し、「Send
」をクリックします.これまで、すべての注文データが出力されます.
Update an order collection

入力
{{baseUrl}}/orders/:orderId
Get an orderからid:COE2t0PHBVhWUPm1VF0Sw
をインポート
入力orderId
VALUE
値
GET
からPATCH
に変更し、「Send」をクリックします.
responseのBodyには何も表示されません.
更新の確認

Get All ordersでSendをクリックすると、
idが
COE2t0PHBVhWUPm1VF0Sw
のcustomerName
はJooからJinjooに変更された.Reference
この問題について([Spring]Posman-POSTの使用), 我々は、より多くの情報をここで見つけました https://velog.io/@dingdoooo/Spring-Postman-사용-POSTテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol