Created
May 19, 2018 03:13
-
-
Save nikukyugamer/49cbf3433a43bcbfbceeab85bc6fe776 to your computer and use it in GitHub Desktop.
Post to ChatWork with Faraday
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
| require 'faraday' | |
| connection = Faraday.new | |
| connection.post do |request| | |
| request.url 'https://api.chatwork.com/v2/rooms/YOUR_ROOM_ID/messages' | |
| request.headers['X-ChatWorkToken'] = 'YOUR CHATWORK TOKEN' | |
| request.body = { body: '[info][title]ここにタイトルが入る[/title]ここに本文が入る[/info]' } | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment