https icon indicating copy to clipboard operation
https copied to clipboard

Url issue

Open bigN13 opened this issue 7 years ago • 1 comments

I am installing the addin with

tns plugin add nativescript-https

Next, I am adding the basic call:

import * as Https from 'nativescript-https'
Https.request({
	url: 'https://wegossipapp.com/api/newuser',
	method: 'GET',
	headers: {
		'Authorization': 'Basic ZWx1c3VhcmlvOnlsYWNsYXZl',
		'x-uuid': 'aHR0cHdhdGNoOmY',
		'x-version': '4.2.0',
		'x-env': 'DEVELOPMENT',
	},
}).then(function(response) {
	console.log('Https.request response', response)
}).catch(function(error) {
	console.error('Https.request error', error)
})

and, I am getting the url parameter doesn't exist in type "HttpsRequestOptions". After some investigation of the github code i can see that the https.common.d.ts file is not the same and its missing bunch of stuff like url param:

export interface HttpsRequestOptions extends HttpRequestOptions {
    method: 'GET' | 'POST';
    headers?: Headers;
    content?: string;
}

am i missing something?

bigN13 avatar Jan 14 '18 10:01 bigN13

I am also hitting this issue. Any solutions?

EmandM avatar Aug 27 '18 05:08 EmandM