Created
September 8, 2017 06:06
-
-
Save sushant12/188d922edb3efa07c4c04c32b3b8299b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| uri = URI.parse("https://oapi.dingtalk.com/robot/send") | |
| https = Net::HTTP.new(uri.host, uri.port) | |
| https.use_ssl = true | |
| req = Net::HTTP::Post.new(uri.path.concat("?access_token=#{setting_chat.token}")) | |
| req['Content-Type'] = 'application/json' | |
| # req['charset'] = 'UTF-8' | |
| req.body = { | |
| "msgtype": "text", | |
| "text": { | |
| "content": "Hello world" | |
| } | |
| }.to_json | |
| res = https.request(req) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment