Sha256: 16b699e0cd404d90c0f4ed4dc6fd34bc663c9e3ba7dc47e99832189b44e8b7dc

Contents?: true

Size: 421 Bytes

Versions: 4

Compression:

Stored size: 421 Bytes

Contents

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require File.expand_path('../../lib/discourse_api', __FILE__)

client = DiscourseApi::Client.new("http://localhost:3000")
client.api_key = "YOUR_API_KEY"
client.api_username = "YOUR_USERNAME"

# Upload an image via file
client.upload_post_image(file: 'grumpy_cat.gif')

# Upload an image via URL
client.upload_post_image(url: 'https://giphy.com/grumpy_cat.gif')

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
discourse_api-0.15.0 examples/upload.rb
discourse_api-0.14.1 examples/upload.rb
discourse_api-0.14.0 examples/upload.rb
discourse_api-0.13.0 examples/upload.rb