Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The official API client and SDK built by [NeutrinoAPI](https://www.neutrinoapi.c

| Feature | |
|------------------|--------|
| Platform Version | >= 10 |
| Platform Version | >= 6 |
| HTTP Library | Native |
| JSON Library | Native |
| HTTP/2 | No |
Expand Down
7 changes: 6 additions & 1 deletion src/client/neutrino-api-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const APIResponse = require('./api-response');
const fs = require('fs');
const https = require('https');
const { promisify } = require('util');
const { URL, URLSearchParams } = require('url');

/**
* Make a request to the Neutrino API
Expand Down Expand Up @@ -549,6 +550,10 @@ class NeutrinoAPIClient
url = new URL(`${this.baseURL}/${endpoint}`);
}
const options = {
'protocol': url.protocol,
'hostname': url.hostname,
'port': url.port,
'path': url.pathname + url.search,
'headers': {
'User-id': this.userID,
'API-Key': this.apiKey,
Expand All @@ -558,7 +563,7 @@ class NeutrinoAPIClient
'method': httpMethod
};
try {
const request = https.request(url, options, (response) => {
const request = https.request(options, (response) => {
const statusCode = response.statusCode || 0;
const contentType = response.headers['content-type'] || '';
let data = '';
Expand Down