add http body

HTTPリクエストにメッセージ本文を追加します。
名前説明タイプ修飾子
content

メッセージ本文のデータです。

Stringなし
なし
このアクションは、次のプロジェクト項目で使用できます: テストモジュールおよびユーザー定義アクションです。
次の設定はこのアクションに適用可能です:  remove double quotes from cells.

特定のGoogle APIをテストして、以下の情報で受信者にメッセージを送信したいと仮定しましょう: 

  • テスト対象のAPI: Users.messages: send.
  • URI:https://www.googleapis.com/gmail/v1/users/me/messages/send
  • 認証スキーム: OAuth 2.0
  • リクエスト本文に、以下のプロパティをメタデータとして持つUsers.messagesリソースを提供します。
    プロパティ名詳細
    rawbytesメールメッセージ全体をbase64urlエンコードされた文字列で指定します。
    ヒント: 
    プレーンテキスト文字列をbase64urlエンコードされた文字列に変換するには、Online Base64URL encoder を使用できます。
    • 生の本文コンテンツ: 
                              
                                  To: [email protected]
      Subject: This is a test mail
      &nbsp
      This is a test mail
                              
                          
    • Base64urlエンコードされた本文コンテンツ: 
      VG86IGxvZ2lnZWFyZXBndGVzdDJAZ21haWwuY29tClN1YmplY3Q6IFRoaXMgaXMgdGVzdCBtYWlsCgpUaGlzIGlzIGEgdGVzdCBtYWls
    • JSON形式で宣言されたリクエスト本文{"raw":"base64url encoded string"}
                                
                                    	name	value			
local variable	access token	ya29.Ci-fa76X0cjJXa2Lx0RM-fRyAQ6-6pboEX-iuT7PR-yYv6D-Rfbos7bs151wiL-O7w			
local variable	uri	https://www.googleapis.com/gmail/v1/users/[email protected]/messages/send			
local variable	encoded body content	VG86IGxvZ2lnZWFyZXBndGVzdDJAZ21haWwuY29tClN1YmplY3Q6IFRoaXMgaXMgdGVzdCBtYWlsCgpUaGlzIGlzIGEgdGVzdCBtYWls			
&nbsp					
create http request					
&nbsp					
	schema	value			
authenticate	oauth 2	# access token			
&nbsp					
	key	value			
add http header	Content-type	application/json			
&nbsp					
	content				
add http body	# "{""raw"":""" & encoded body content & """}"				
&nbsp					
	uri	method	timeout	variable	expected code
send http request	# uri	POST	200	>>response	200
&nbsp					
	response	status	header	body	
parse http response	# response	>>status	>>header	>>body	
                                
                            
  • このビルトインアクションを呼び出す前に、HTTPリクエストは create http request を使ってインスタンス化する必要があります。
  • リクエストボディのプロパティはJSON形式で記述される必要があります。
  • このアクションは修飾子 <ignore> をサポートしています。引数の値として <ignore> が存在するか、引数に <ignore> に評価される式が含まれている場合、そのアクションは実行中にスキップされます。

Copyright © 2023 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1(800) 322-0333