|
6 | 6 | module AvaTax |
7 | 7 | module Request |
8 | 8 |
|
9 | | - def get(path, options={}) |
10 | | - request(:get, path, nil, options) |
| 9 | + def get(path, options={}, apiversion="") |
| 10 | + request(:get, path, nil, options, apiversion) |
11 | 11 | end |
12 | 12 |
|
13 | | - def post(path, model, options={}) |
14 | | - request(:post, path, model, options) |
| 13 | + def post(path, model, options={}, apiversion="") |
| 14 | + request(:post, path, model, options, apiversion) |
15 | 15 | end |
16 | 16 |
|
17 | | - def put(path, model, options={}) |
18 | | - request(:put, path, model, options) |
| 17 | + def put(path, model, options={}, apiversion="") |
| 18 | + request(:put, path, model, options, apiversion) |
19 | 19 | end |
20 | 20 |
|
21 | | - def delete(path, options={}) |
22 | | - request(:delete, path, nil, options) |
| 21 | + def delete(path, options={}, apiversion="") |
| 22 | + request(:delete, path, nil, options, apiversion) |
23 | 23 | end |
24 | 24 |
|
25 | | - def request(method, path, model, options={}) |
| 25 | + def request(method, path, model, options={}, apiversion="") |
26 | 26 | response = connection.send(method) do |request| |
| 27 | + request.headers['X-Avalara-Client'] = request.headers['X-Avalara-Client'].gsub("API_VERSION", apiversion) |
27 | 28 | case method |
28 | 29 | when :get, :delete |
29 | 30 | request.url("#{encode_path(path)}?#{URI.encode_www_form(options)}") |
|
0 commit comments