Created
May 13, 2016 23:08
-
-
Save jewilmeer/eb40abd665b70f53e6eb60801de24342 to your computer and use it in GitHub Desktop.
This file contains 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
--------------------------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-- |
This file contains 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
curl -v -XPOST -F provider=telegraaf -F [email protected] localhost:9292/item_deliveries |
This file contains 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
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