Can the params
object of an Axios config of a get request accept a query parameter with no value, to construct a URL such as http://example.com/foo?a=true&b
? Perhaps something like:
const val = true
axios.get('/api/my_page/', {
params: {
a: val,
b // although JavaScript interprets this as `b: b`
}
})
Or is my only option to put the query parameters directly in the URL, with something like:
axios.get(`/api/my_page/?a=${val}&b`)