amazon web services - How to specify method request path variables with aws apigateway CLI -


i have route defined in aws api gateway uses path variable, accessed so:

/route/{variable} 

it configured , working expect, except cannot find how test route via cli. when use aws console's "test" function on method, prompts me enter desired value variable. this, , works expected, following appearing in execution logs:

thu jan 07 16:30:06 utc 2016 : method request path: {variable=my specified value} thu jan 07 16:30:06 utc 2016 : method request headers: {} 

however when execute using cli command:

$ aws apigateway test-invoke-method --rest-api-id {rest-api-id} --resource-id {resource-id} --http-method --path-with-query-string 'variable=my specified value' 

i 500 ise response, following in logs:

thu jan 07 16:38:20 utc 2016 : method request path: {} thu jan 07 16:38:20 utc 2016 : method request headers: {} thu jan 07 16:38:20 utc 2016 : execution failed due configuration error: unable transform input 

i've tried many variations on theme, including using json-encoded string --path-with-query-string value (e.g. {"variable":"my specified value"}), using raw path (e.g. /route/my%20specified%20value), , several others.

i've tried specifying value using --stage-variables switch, , making --path-with-query-string value blank. yields same result.

i've been able call work specifying --headers '{"variable":"my specified value"}' doesn't seem correct circumvents path variable, isn't valid test. there way specify method request path variables using cli? help.

you want issue command using full path, i.e.:

$ aws apigateway test-invoke-method --rest-api-id abc123 --resource-id xyz987 --http-method --path-with-query-string '/route/123'

the error message above indicates error request body transformation. may need specify --body parameter, and/or specify accept/content-type headers via --headers parameter.

let me know if helps.

thanks, ryan


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -