lib/loquor/http_actions/post.rb in loquor-0.1.1 vs lib/loquor/http_actions/post.rb in loquor-0.1.2
- old
+ new
@@ -8,14 +8,14 @@
super(url, deps)
@payload = payload
end
def post
- @config.logger.info "Making POST request to: #{@url}"
+ @config.logger.info "Making POST request to: #{full_url}"
response = JSON.parse(signed_request.execute)
@config.logger.info "Signed request executed. Response: #{response}"
- response
+ Representation.new(response)
end
private
def signed_request
@@ -23,14 +23,17 @@
p signed_request # If you take this line out - it all breaks. Yeah...
signed_request
end
def request
- full_url = "#{@config.endpoint}#{@url}"
RestClient::Request.new(url: full_url,
accept: :json,
payload: @payload.to_json,
headers: {'Content-type' => 'application/json'},
method: :post)
+ end
+
+ def full_url
+ "#{@config.endpoint}#{@url}"
end
end
end