add http header

Add a key/value pair as an HTTP header field that you might want to include with your request.
NameDescriptionTypeModifier
key

Name of the header field.

StringNone
value

(Optional) Value of the header field

StringNone
None
This action may be used within the following project items: test modules and user-defined actions.
The following settings are applicable to this action: remove double quotes from cells.

Suppose that you'd like to test a Google Maps API with the following header fields:

        
            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					
	uri	method	timeout	variable	expected code
send http request	# uri	GET	200	>>response	200
                                
                            
  • An HTTP request must be instantiated via create http request before calling this built-in action.
  • Refer to here for syntax and semantics of all standard HTTP header fields. In general, each header field consists of a name followed by a colon (":") and the field value.
  • This action supports the <ignore> modifier. If the string <ignore> is present as the value of any of the arguments, or any argument contains an expression that evaluates to <ignore>, the action is skipped during execution.

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