usda_fdc 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/usda_fdc/client.rb +3 -3
- data/lib/usda_fdc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b834a400890953356c7e7a6265bd5f5126724d2a5009295160fc0a9fcabfecf1
|
4
|
+
data.tar.gz: 7d41308bc4ca5d3f1ffaf3be668b9f910f1cde9422727bc5592224776b30ae36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b52fc6edacaada7389148783465473e4d73b86089f289ed9208ba99ac8fd3457e7acdb8a42184aa789f9c509d37785c0250c2a0705484814cf20c12835376413
|
7
|
+
data.tar.gz: b59138eb82af2fd0611d8869a63cff8e2f04bb922228ba549b9bb749c5152fa41302fe1fda7b7b9cb8ff1b16b0a3258ee328bd4580efde9306e7f446af406803
|
data/CHANGELOG.md
CHANGED
data/lib/usda_fdc/client.rb
CHANGED
@@ -34,7 +34,7 @@ module UsdaFdc
|
|
34
34
|
uri.query = URI.encode_www_form(params) if params.any?
|
35
35
|
|
36
36
|
request = Net::HTTP::Get.new(uri)
|
37
|
-
|
37
|
+
assign_default_headers(request)
|
38
38
|
|
39
39
|
yield(request) if block_given?
|
40
40
|
|
@@ -49,7 +49,7 @@ module UsdaFdc
|
|
49
49
|
uri = URI("#{API_URL}#{path}")
|
50
50
|
|
51
51
|
request = Net::HTTP::Post.new(uri)
|
52
|
-
|
52
|
+
assign_default_headers(request)
|
53
53
|
request.body = body.to_json
|
54
54
|
|
55
55
|
yield(request) if block_given?
|
@@ -63,7 +63,7 @@ module UsdaFdc
|
|
63
63
|
|
64
64
|
private
|
65
65
|
|
66
|
-
def
|
66
|
+
def assign_default_headers(request)
|
67
67
|
request['X-Api-Key'] = @api_key
|
68
68
|
request['Content-Type'] = 'application/json'
|
69
69
|
request['User-Agent'] = "usda_fdc gem (v#{UsdaFdc::VERSION})"
|
data/lib/usda_fdc/version.rb
CHANGED