httpplease.js
httpplease.js copied to clipboard
get request doesn't work
This code
1 require('httpplease')({ method: 'GET',
2 url: 'https://thingspace.io/get/dweets/for/no_thing',
3 headers: {}
4 },function(err,response) {
5 console.log('text: ',response)
6 })
just logs
text: Response {
request:
Request {
method: 'GET',
url: 'https://thingspace.io/get/dweets/for/no_thing',
headers: {},
timeout: 0,
errorOn404: true,
onload: undefined,
onerror: undefined,
xhr:
{ UNSENT: 0,
OPENED: 1,
HEADERS_RECEIVED: 2,
LOADING: 3,
DONE: 4,
readyState: 1,
onreadystatechange: null,
responseText: '',
responseXML: '',
status: 0,
statusText: null,
withCredentials: false,
open: [Function],
setDisableHeaderCheck: [Function],
setRequestHeader: [Function],
getResponseHeader: [Function],
getAllResponseHeaders: [Function],
getRequestHeader: [Function],
send: [Function],
handleError: [Function],
abort: [Function],
addEventListener: [Function],
removeEventListener: [Function],
dispatchEvent: [Function],
onload: null,
onerror: null,
onabort: null,
ontimeout: null,
onprogress: null } },
xhr:
{ UNSENT: 0,
OPENED: 1,
HEADERS_RECEIVED: 2,
LOADING: 3,
DONE: 4,
readyState: 1,
onreadystatechange: null,
responseText: '',
responseXML: '',
status: 0,
statusText: null,
withCredentials: false,
open: [Function],
setDisableHeaderCheck: [Function],
setRequestHeader: [Function],
getResponseHeader: [Function],
getAllResponseHeaders: [Function],
getRequestHeader: [Function],
send: [Function],
handleError: [Function],
abort: [Function],
addEventListener: [Function],
removeEventListener: [Function],
dispatchEvent: [Function],
onload: null,
onerror: null,
onabort: null,
ontimeout: null,
onprogress: null },
headers: {},
status: 0,
text: '',
body: '',
contentType: null,
isHttpError: false }
It has a status of 0, no text, and not body. However, when I enter the url into my browser, I get the expected result. There is nothing in the documentation about what to do with the response object, so I might be doing something wrong there.
Did you try logging the error?
This is probably a duplicate of #23
This dose not cut the standards anymore, xhr isn't streamable, and don't exist in web worker IE is also dead and unsupported soon in agust by MS themself.
How about deprecating this package, archive the repo and suggest for alternatives? this haven't been updated in years