add http header

リクエストに含めたいHTTPヘッダーフィールドとそのキー/値のペアを追加します。
名前説明タイプ修飾子
key

ヘッダーフィールドの名前です。

Stringなし
value

(任意)ヘッダーフィールドの値です。

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

以下のヘッダーフィールドを使用してGoogle Maps APIをテストすると仮定します: 

        
            Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
Authorization: Basic Sm9obi5TBWI0aDpwQHNzd29yZA==
Host: maps.googleapis.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1(java1.5)
        
    
                                
                                    	name	value			
local variable	uri	http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false			
&nbsp					
create http request					
&nbsp					
	key	value			
add http header	Accept-Encoding	gzip;q=1.0, identity; q=0.5, *;q=0			
add http header	Authorization	Basic Sm9obi5TBWI0aDpwQHNzd29yZA==			
add http header	Host	maps.googleapis.com			
add http header	Connection	Keep-Alive			
add http header	User-Agent	Apache-HttpClient/4.1.1(java1.5)			
&nbsp					
	url	method	timeout	variable	expected code
send http request	# uri	GET	200	>>response	200
                                
                            
  • このビルトインアクションを呼び出す前に、HTTPリクエストは create http request を使ってインスタンス化する必要があります。
  • 全ての標準HTTPヘッダーフィールドの構文と意味については、 こちら を参照してください。一般的に、各ヘッダーフィールドは名前の後にコロン(":")とフィールド値が続きます。
  • このアクションは修飾子 <ignore> をサポートしています。引数のいずれかの値として文字列 <ignore> が含まれているか、或いはどの引数かが <ignore> に評価される式を含んでいる場合、そのアクションは実行中にスキップされます。

Copyright © 2024 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 (650) 572-1400