APIGateway.Client.
test_invoke_method
(**kwargs)¶Simulate the invocation of a Method in your RestApi with headers, parameters, and an incoming request body.
See also: AWS API Documentation
Request Syntax
response = client.test_invoke_method(
restApiId='string',
resourceId='string',
httpMethod='string',
pathWithQueryString='string',
body='string',
headers={
'string': 'string'
},
multiValueHeaders={
'string': [
'string',
]
},
clientCertificateId='string',
stageVariables={
'string': 'string'
}
)
[REQUIRED]
The string identifier of the associated RestApi.
[REQUIRED]
Specifies a test invoke method request's resource ID.
[REQUIRED]
Specifies a test invoke method request's HTTP method.
A key-value map of headers to simulate an incoming invocation request.
The headers as a map from string to list of values to simulate an incoming invocation request.
A key-value map of stage variables to simulate an invocation on a deployed Stage.
dict
Response Syntax
{
'status': 123,
'body': 'string',
'headers': {
'string': 'string'
},
'multiValueHeaders': {
'string': [
'string',
]
},
'log': 'string',
'latency': 123
}
Response Structure
(dict) --
Represents the response of the test invoke request in the HTTP method.
status (integer) --
The HTTP status code.
body (string) --
The body of the HTTP response.
headers (dict) --
The headers of the HTTP response.
multiValueHeaders (dict) --
The headers of the HTTP response as a map from string to list of values.
log (string) --
The API Gateway execution log for the test invoke request.
latency (integer) --
The execution latency of the test invoke request.
Exceptions
APIGateway.Client.exceptions.BadRequestException
APIGateway.Client.exceptions.UnauthorizedException
APIGateway.Client.exceptions.NotFoundException
APIGateway.Client.exceptions.TooManyRequestsException