http_api_client 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +8 -0
- data/lib/http_api_client/client.rb +3 -3
- data/lib/http_api_client/timed_result.rb +1 -1
- data/lib/http_api_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTY3ZmUyYjk3ZWUxYjZkMGI4ZjFkNDAxZjk3NjAwNWFkM2E0YzFmZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzBmMjIzZDc0Mjg2ZTk1NDQyMGYwMDI3MWExZDdjMjMyY2QzYWE4ZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWVjYzBiMmY4ZDExNzM4ZDIxMDFkMjdkNWQ3OWViODY0NGFlMjk0MGJiNDAz
|
10
|
+
MjkyMmRhNmVkMDY5M2ZhNWE2MTg3ZGJkNjg4YTI0OGE4MzFmOTZjNjg3NDQx
|
11
|
+
N2ZlZmIxYjEwOGIwYTg1YWZjYzlmZjI3NjFiZjRkMzlmZjY2ZGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTkwYmNhOTVhYjU4NjU1NjNmYjFkZGMwMWIwNmMyNjU4MGRlYWU2ZTE4ZTg3
|
14
|
+
MjZjNjQ3ZGY4MDRlYmJiNzBjOTllMzcwNDhjYjAxMzRiOWMzOWMzMTQwOWEz
|
15
|
+
ZjE2ZGI2ZDA2NWNiMzJjZGM4ZTBmMTkwYjZmNmQ4MmNlOWE3YjM=
|
data/README.md
CHANGED
@@ -141,3 +141,11 @@ This will install `/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt`
|
|
141
141
|
## TODO:
|
142
142
|
|
143
143
|
* Consider enforcing an SSL connection when using HTTP Basic Auth
|
144
|
+
|
145
|
+
## Release Notes
|
146
|
+
|
147
|
+
### 0.1.0 - 2014-04-03
|
148
|
+
* Initial release
|
149
|
+
|
150
|
+
### 0.1.1 - 2014-04-04
|
151
|
+
* Allow logger to be injected
|
@@ -41,7 +41,7 @@ module HttpApiClient
|
|
41
41
|
|
42
42
|
def get(path, query = {}, custom_headers = {})
|
43
43
|
|
44
|
-
log_data = { method: 'get',
|
44
|
+
log_data = { method: 'get', remote_host: config.server, path: path_with_query(path, query) }
|
45
45
|
|
46
46
|
response = TimedResult.time('http_api_client_request', log_data) do
|
47
47
|
connection.get(full_path(path), with_auth(query), request_headers(get_headers, custom_headers))
|
@@ -52,7 +52,7 @@ module HttpApiClient
|
|
52
52
|
|
53
53
|
def create(path, payload, custom_headers = {})
|
54
54
|
|
55
|
-
log_data = { method: 'post',
|
55
|
+
log_data = { method: 'post', remote_host: config.server, path: full_path(path) }
|
56
56
|
|
57
57
|
response = TimedResult.time('http_api_client_request', log_data) do
|
58
58
|
connection.post(full_path(path), JSON.fast_generate(with_auth(payload)), request_headers(update_headers, custom_headers))
|
@@ -64,7 +64,7 @@ module HttpApiClient
|
|
64
64
|
def destroy(base_path, id, custom_headers = {})
|
65
65
|
|
66
66
|
path = "#{base_path}/#{id}"
|
67
|
-
log_data = { method: 'delete',
|
67
|
+
log_data = { method: 'delete', remote_host: config.server, path: full_path(path) }
|
68
68
|
|
69
69
|
response = TimedResult.time('http_api_client_request', log_data) do
|
70
70
|
connection.delete(full_path(path), request_headers(update_headers, custom_headers))
|
@@ -8,7 +8,7 @@ class TimedResult
|
|
8
8
|
|
9
9
|
time = millis_since(start_time)
|
10
10
|
|
11
|
-
log_entries = ["
|
11
|
+
log_entries = ["event_name=#{event}"]
|
12
12
|
log_entries << "request_id=#{Thread.current[:request_id]}" if Thread.current[:request_id]
|
13
13
|
log_entries << "timing=#{time}"
|
14
14
|
log_entries.concat(log_data.to_param.split('&'))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Monie
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-04-
|
14
|
+
date: 2014-04-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|