Created
November 11, 2014 04:56
-
-
Save craigmarksmith/35adf07e097e71189623 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
conn = Faraday.new(:url => 'http://AJANIS_IP_ADDRESS:4502/') do |faraday| | |
faraday.use Faraday::Request::BasicAuthentication, 'admin','admin' | |
faraday.use ForceUtf8 | |
faraday.response :json | |
faraday.request :multipart | |
faraday.request :url_encoded | |
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP | |
end | |
payload = { | |
description: 'a test', | |
title: 'test command line', | |
tags: ['workflow:projects','workflow:projects/wcm'], | |
center_service_ref: 'commandline-test-boc', #per anjani, full referring url works fine | |
path: '/scentre-group/center/au/bondijunction', | |
boc_user: "test@westfield.com", | |
initial_boc_user: "test@westfield.com", | |
upload_file: Faraday::UploadIO.new('/PATH/TO/testimage.jpg', 'image/jpeg') | |
} | |
r = conn.post("/bin/dam/api/upload", payload) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment