Closed lcherone closed 4 years ago
This issue as been imported as question since it does not respect http issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/http/issues/c20.
bot closed it, ill leave it with you..
additionally, the response object looks like:
Response
body: ReadableStream
locked: false
__proto__: ReadableStream
bodyUsed: false
headers: Headers
__proto__: Headers
ok: true
redirected: false
status: 200
statusText: "OK"
type: "cors"
url: "http://icanhazip.com/"
__proto__: Response
network all good and shows content (ip).. also the same error if done outside of asyncData
as a normal method and called in mounted.. maybe I'm missing something obvious
Just FYI for other who got this issue. It seems that the document is missing response promise chain, so it should be
const requestData = await $http.get('http://icanhazip.com')
const ip = await requestData.text()
return { ip }
@jukbot yup.. but rtm: https://http.nuxtjs.org/guide/usage.html#using-in-asyncdata
I'm getting the above error using code directly taken from the example in docs:
https://http.nuxtjs.org/guide/usage.html#using-in-asyncdata
browser
console