(api_key, auth_token)
| 35 | |
| 36 | // A promisey wrapper for api requests |
| 37 | function apiRequest(api_key, auth_token) { |
| 38 | var post_data = querystring.stringify({ |
| 39 | token: auth_token, |
| 40 | apiKey: api_key, |
| 41 | format: 'json', |
| 42 | }); |
| 43 | |
| 44 | var post_options = { |
| 45 | host: 'rpxnow.com', |
| 46 | path: '/api/v2/auth_info', |
| 47 | method: 'POST', |
| 48 | headers: { |
| 49 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 50 | 'Content-Length': post_data.length, |
| 51 | }, |
| 52 | }; |
| 53 | |
| 54 | return httpsRequest.request(post_options, post_data); |
| 55 | } |
| 56 | |
| 57 | module.exports = { |
| 58 | validateAppId: validateAppId, |
no test coverage detected