Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Gatewayを通してbot動かした時に日本語文字化けする #18

Closed
chocopie116 opened this issue Aug 15, 2017 · 2 comments
Closed

Comments

@chocopie116
Copy link
Owner

image

http://blog.serverworks.co.jp/tech/2016/09/17/slack-apigateway-lambda-japanese/

@chocopie116
Copy link
Owner Author

## &区切りでPOSTされてきたデータを分割する
#set($httpPost = $util.urlDecode($input.path('$')).split("&"))

## 出力されるJSONデータの生成
{
#foreach( $keyValue in $httpPost )
 ## "key=value"というデータをkeyとvalueに分ける
 #set($data = $keyValue.split("="))
 ## JSONのフォーマットに整形する(まだ走査するデータがあれば","を挿入する)
 "$data[0]" : "$data[1]"#if( $foreach.hasNext ),#end
#end
}

@chocopie116
Copy link
Owner Author

よさげ。
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant