Skip to content

Instantly share code, notes, and snippets.

@jewilmeer
Created May 13, 2016 23:08
Show Gist options
  • Save jewilmeer/eb40abd665b70f53e6eb60801de24342 to your computer and use it in GitHub Desktop.
Save jewilmeer/eb40abd665b70f53e6eb60801de24342 to your computer and use it in GitHub Desktop.
--------------------------45b6a57535ac8600
Content-Disposition: form-data; name="provider"
telegraaf
--------------------------45b6a57535ac8600
Content-Disposition: form-data; name="file"; filename="config.ru"
Content-Type: application/octet-stream
# frozen_string_literal: true
require './app'
require 'rack/contrib'
require 'newrelic-webmachine'
use Blendle::Middlewares::CommonLogger
use Rack::Deflater
run Blendle::Workflow::App.adapter
--------------------------45b6a57535ac8600--
curl -v -XPOST -F provider=telegraaf -F [email protected] localhost:9292/item_deliveries
module Blendle
module Workflow
class ItemDeliveriesResource < Blendle::API::Resources::BaseResource
def content_types_accepted
[['multipart/form-data', :from_form]]
end
def allowed_methods
%w(POST)
end
def post_is_create?; true end
def create_path
'issue/my-issue/item/1234'
end
def from_form
File.write('/tmp/upload', request.body.to_io.read)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment