embulk-input-http 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3064560ca6c74c5dd45192601f60be97baecbd9
4
- data.tar.gz: 90c0938ad61f88f669f1953adda9fddaf42ce7e2
3
+ metadata.gz: 913d001d72650ad4679b8096fe04f54a937f7926
4
+ data.tar.gz: 9af3fe59316a75a451a96469f58412ae769c07e1
5
5
  SHA512:
6
- metadata.gz: 7f05f57578d98069719c77d922d2a4ff9d1379890c3ebaabfff23ecb4637bd619042f981f39ec1025cd5106e48e4caefd670191e9418fbb48ea5aabf268166da
7
- data.tar.gz: f13f0abb999c3293ec484318aa4c57f4e2281a3dd98aa458029fd775969f236263831b23c931c63bf29ca57c25f1d49cb01e5f683ac4725439ee2cb971b0cbc5
6
+ metadata.gz: 948497dd6ec01d497b478730a4bb22a53a2c3ed1e35ce50ae9d24c3284e8655cd1f7ceab19555e7b4fb538ad80e0199590781a31866b4b0925fbec02ea5414d0
7
+ data.tar.gz: 3e5d676d85d6c070f29a33a9dbe7795569b6538e05cc3d8c79bf10299492631d006236fc48622c78d49ab0b8a4d203d2e8c90a4cc221033f45c1eced4856d5a0
data/README.md CHANGED
@@ -32,6 +32,7 @@ in:
32
32
  - **params**: pair of name/value to specify query parameter (optional)
33
33
  - **method**: http method, get is used by default (optional)
34
34
  - **user_agent**: the usrr agent to specify request header (optional)
35
+ - **request_headers**: the extra request headers as key-value (optional)
35
36
  - **charset**: charset to specify request header (optional, utf-8 is used by default)
36
37
  - **basic_auth**: username/password for basic authentication (optional)
37
38
  - **open_timeout**: timeout msec to open connection (optional, 2000 is used by default)
@@ -90,6 +91,7 @@ in:
90
91
  - {name: method, value: getStations}
91
92
  - {name: x, value: 135.0}
92
93
  - {name: y, value: "{35,34,33,32,31}.0", expand: true}
94
+  request_headers: {X-Some-Key1: some-value1, X-Some-key2: some-value2}
93
95
  parser:
94
96
  type: json
95
97
  root: $.response.station
@@ -129,7 +131,6 @@ in:
129
131
 
130
132
  ## TODO
131
133
  - HTTP-proxy
132
- - Custom hedaers
133
134
  - Guess
134
135
 
135
136
  ## Patch
data/build.gradle CHANGED
@@ -13,7 +13,7 @@ configurations {
13
13
  provided
14
14
  }
15
15
 
16
- version = "0.0.11"
16
+ version = "0.0.12"
17
17
 
18
18
  sourceCompatibility = 1.7
19
19
  targetCompatibility = 1.7
@@ -6,13 +6,14 @@ in:
6
6
  params:
7
7
  - {name: method, value: getStations}
8
8
  - {name: x, value: 135.0}
9
- - {name: y, value: "{35,34,33,32,31}.0", expand: true}
10
- - {name: z, values: ["a", "b", "c"], expand: true}
9
+ - {name: y, value: "{35,34,33,32,31}.0", expand: 1}
10
+ - {name: z, values: ["a", "b", "c"], expand: 1}
11
11
  method: get
12
12
  user_agent: example_json
13
13
  charset: utf8
14
- interval_includes_response_time: yes
15
14
  request_interval: 600
15
+ interval_includes_response_time: 1
16
+ request_headers: {X-Some-Key1: some-value1, X-Some-key2: some-value2}
16
17
  parser:
17
18
  type: none
18
19
 
data/settings.gradle ADDED
@@ -0,0 +1 @@
1
+ rootProject.name = 'embulk-input-http'
@@ -34,6 +34,7 @@ import java.io.UnsupportedEncodingException;
34
34
  import java.net.URISyntaxException;
35
35
  import java.util.ArrayList;
36
36
  import java.util.List;
37
+ import java.util.Map;
37
38
 
38
39
  public class HttpInputPlugin implements FileInputPlugin {
39
40
 
@@ -89,6 +90,11 @@ public class HttpInputPlugin implements FileInputPlugin {
89
90
  @ConfigDefault("null")
90
91
  public Optional<BasicAuthConfig> getBasicAuth();
91
92
 
93
+ @Config("request_headers")
94
+ @ConfigDefault("{}")
95
+ public Map<String, String> getRequestHeaders();
96
+
97
+
92
98
  @ConfigInject
93
99
  public BufferAllocator getBufferAllocator();
94
100
 
@@ -227,6 +233,9 @@ public class HttpInputPlugin implements FileInputPlugin {
227
233
  headers.add(new BasicHeader("Accept-Encoding", "gzip, deflate"));
228
234
  headers.add(new BasicHeader("Accept-Language", "en-us,en;q=0.5"));
229
235
  headers.add(new BasicHeader("User-Agent", task.getUserAgent()));
236
+ for (Map.Entry<String,String> entry : task.getRequestHeaders().entrySet()) {
237
+ headers.add(new BasicHeader(entry.getKey(), entry.getValue()));
238
+ }
230
239
  return headers;
231
240
  }
232
241
 
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuma kanari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-07 00:00:00.000000000 Z
11
+ date: 2017-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
15
- version_requirements: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ~>
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
14
  requirement: !ruby/object:Gem::Requirement
21
15
  requirements:
22
16
  - - ~>
23
17
  - !ruby/object:Gem::Version
24
18
  version: '1.0'
19
+ name: bundler
25
20
  prerelease: false
26
21
  type: :development
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
22
  version_requirements: !ruby/object:Gem::Requirement
30
23
  requirements:
31
- - - '>='
24
+ - - ~>
32
25
  - !ruby/object:Gem::Version
33
- version: '10.0'
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
30
  - - '>='
37
31
  - !ruby/object:Gem::Version
38
32
  version: '10.0'
33
+ name: rake
39
34
  prerelease: false
40
35
  type: :development
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
41
  description: Fetch data via http
42
42
  email:
43
43
  - chemtrails.t@gmail.com
@@ -57,6 +57,7 @@ files:
57
57
  - gradlew
58
58
  - gradlew.bat
59
59
  - lib/embulk/input/http.rb
60
+ - settings.gradle
60
61
  - src/main/java/org/embulk/input/BasicAuthConfig.java
61
62
  - src/main/java/org/embulk/input/HttpInputPlugin.java
62
63
  - src/main/java/org/embulk/input/ParamsConfig.java
@@ -67,7 +68,7 @@ files:
67
68
  - src/test/java/org/embulk/input/TestQueryConfig.java
68
69
  - classpath/commons-codec-1.9.jar
69
70
  - classpath/commons-logging-1.2.jar
70
- - classpath/embulk-input-http-0.0.11.jar
71
+ - classpath/embulk-input-http-0.0.12.jar
71
72
  - classpath/httpclient-4.4.jar
72
73
  - classpath/httpcore-4.4.jar
73
74
  homepage: https://github.com/takumakanari/embulk-input-http