diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/services/http_service.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/http_service.rb b/app/services/http_service.rb index d3999f293..db4441395 100644 --- a/app/services/http_service.rb +++ b/app/services/http_service.rb @@ -26,7 +26,8 @@ module HTTPService extend self # params: { netex_import: {referential_id: 13, workbench_id: 1}}, # upload: {file: [StringIO.new('howdy'), 'application/zip', 'greeting']}) def post_resource(host:, path:, token: nil, params: {}, upload: nil) - result = Faraday.new(url: host) do |c| + token = token || params + Faraday.new(url: host) do |c| c.headers['Authorization'] = "Token token=#{token.inspect}" if token c.request :multipart c.request :url_encoded |
