You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I'm coding a plugin with colibri-software's plugin supported engine & inside it i'm using a restful api client for interacting with locomotivecms web service but right at starting , web server (puma) encounter to this error:
I use httparty & rest-client and both of them have this problem. another thing that i have to mention is there is not any problem in shell and through curl , httparty , rest-client & also Advanced Rest client extention of chrome every thing works fine.
in my plugin at first i include this items:
$api_base_url = "ADDRESS"
$api_key = "MY API CODE"
Locomotive::Mounter::EngineApi.set_token(uri: "http://#{$api_base_url}/locomotive/api", api_key: $api_key)
attributes = {
title: 'Hello world',
content: 'Lorem ipsum'
}
query = { query: { 'content_entry' => attributes } }
response = Locomotive::Mounter::EngineApi.post("/content_types/posts/entries.json", query)
if response.success?
puts "article created"
else
puts "failed to create an article"
end
Another official code sample with get & put also encountered to this error.
I test both localhost on my laptop(linux mint 17) and also domain name on my server(centos6) for $api_base_url.
please advice me to pass this big problem.
Thanks
The text was updated successfully, but these errors were encountered:
Hi
I'm coding a plugin with colibri-software's plugin supported engine & inside it i'm using a restful api client for interacting with locomotivecms web service but right at starting , web server (puma) encounter to this error:
! Unable to load application: Errno::ECONNREFUSED: Connection refused - connect(2)
/home/kwair/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/net/http.rb:763:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
I use httparty & rest-client and both of them have this problem. another thing that i have to mention is there is not any problem in shell and through curl , httparty , rest-client & also Advanced Rest client extention of chrome every thing works fine.
in my plugin at first i include this items:
require 'locomotive_plugins'
require "PLUGIN_NAME/version"
require 'uri'
require 'httparty'
require 'locomotive/mounter'
and then code my client same Didier's code sample at (https://gist.github.com/did/725202d5f4417cbbbc72/revisions) this way:
$api_base_url = "ADDRESS"
$api_key = "MY API CODE"
Locomotive::Mounter::EngineApi.set_token(uri: "http://#{$api_base_url}/locomotive/api", api_key: $api_key)
attributes = {
title: 'Hello world',
content: 'Lorem ipsum'
}
query = { query: { 'content_entry' => attributes } }
response = Locomotive::Mounter::EngineApi.post("/content_types/posts/entries.json", query)
if response.success?
puts "article created"
else
puts "failed to create an article"
end
Another official code sample with get & put also encountered to this error.
I test both localhost on my laptop(linux mint 17) and also domain name on my server(centos6) for $api_base_url.
please advice me to pass this big problem.
Thanks
The text was updated successfully, but these errors were encountered: