Closed dennisfrijlink closed 3 years ago
Never mind. I fixed it by using searchParams
:
async asyncData({ $http }) {
const params = {
consumer_key: process.env.consumer_key,
consumer_secret: process.env.consumer_secret,
orderby: 'date',
per_page: 2,
exclude: 45,
type: 'simple'
};
const res = await $http.get('https://DOMAINNAME/wordpress/wp-json/wc/v3/products/?', { searchParams: params })
const results = await res.json()
return { results }
}
Maybe it's a simple question but how do I use parameters in
nuxt/http
? Innuxt/axios
you can use parameters like:But this won't work using the
nuxt/http
module. Any idea how to pass parameters using this module?