Questions tagged [active-rest-client]

gem for accessing REST services in an Active Record style (where the API dos not follow Rails conventions)

ActiveRestClient is a gem for accessing REST services in an ActiveRecord style. Active Resource already exists, but it doesn't work where the resource naming doesn't follow Rails conventions, it doesn't have in-built caching and it's not as flexible in general.

8 questions
2
votes
1 answer

ActiveRestClient respond to 204 No Content

I have a before_request for all ActiveRestClient calls, but the server is responding with a 204 No Content on some actions. This causes an error: MultiJson::LoadError in FilesController#update 795: unexpected token at '' This is the before_request:…
1
vote
0 answers

ActiveRestClient child classes inherit base class settings

While trying to create a base class using ActiveRestClient in Rails 4.2.0, I've run into an issue trying to configure settings in a base class and have those inherited by child classes. class Foo::Base < ActiveRestClient::Base base_url…
1
vote
0 answers

disable ssl verification on gem active_rest_client

I'm creating a model in Ruby/rails that uses the gem "active-rest_client" (https://github.com/whichdigital/active-rest-client). However my target server only 'speaks' HTTPS with a mismatched SSL cert. So I need to disable SSL verification when I…
pirhac
  • 887
  • 2
  • 8
  • 16
1
vote
1 answer

How to know the `status of my API call` when its `success'?

I want to know the status of my API call when its success. begin @project = Project.find( id: '22', authorization: @auth ) rescue ActiveRestClient::HTTPClientException, ActiveRestClient::HTTPServerException => e Rails.logger.error("Project find…
1
vote
1 answer

ActiveRestClient::HTTPServerException on user Authentication test

When i try in postman for the user authentication, it works perfectly. Request: {"email" : "shane@shane.com", "password": "123"} Response: { "token": "some-token" } But when i try to create a test login. I get…
Frank
  • 179
  • 2
  • 10
0
votes
1 answer

ArgumentError: no time information in "0" using ActiveRestClient in rails 4.2.1

I'm trying to use an API as a database for my rails application using ActiveRestClient, but when I try to query from the API I get an ArgumentError: no time information in "0". I don't understand where the call to time.rb is coming from. Any ideas…
0
votes
1 answer

Show methods not being called - Rails

I am new to rails and I cannot figure out why methods within my show def, inside of my controller, are not being called. I am using ActiveRestClient to grab data from my REST API. Everything is working smoothly in my index.html.erb but when I try to…
-1
votes
1 answer

Access request and response headers in rspec

I am testing my model methods, is there anyway i can access request or response headers. require 'spec_helper' describe Project do it "can find an Project that this user belongs to" do project = Project.find( id: '22', authorization: @auth…
UnderTaker
  • 853
  • 3
  • 13
  • 22