axios.get
accepts a request config as the second parameter (not query string params).
You can use the params
config option to set query string params as follows:
axios.get('/api', {
params: {
foo: 'bar'
}
});
More Related Contents:
- Attach Authorization header for all axios requests
- Handling async request with React, Redux and Axios?
- Axios: chaining multiple API requests
- react native post form data with object and file in it using axios
- Is there a “Best Practices” on designing an application written both in React and React-Native?
- React setState not Updating Immediately
- What is the best way to access redux store outside a react component?
- What is use of curly braces in an ES6 import statement?
- Hide keyboard in react-native
- Can I dispatch an action in reducer?
- how to cancel/abort ajax request in axios
- How to re-render flatlist?
- Sending the bearer token with axios
- Redux: Why is avoiding mutations such a fundamental part of using it?
- How to debug react native apps in visual studio code?
- How does connect work without mapDispatchToProps
- Trace why a React component is re-rendering
- CSRF with Django, React+Redux using Axios
- What is the difference between using constructor vs getInitialState in React / React Native?
- ‘TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received type undefined’
- VirtualizedList: You have a large list that is slow to update
- Jest setup “SyntaxError: Unexpected token export”
- React native change listening port
- How to fix 431 Request Header Fields Too Large in React-Redux app
- Component won’t update when a redux state change occurs
- how to change jest mock function return value in each test?
- how to async/await redux-thunk actions?
- React and TypeScript—which types for an Axios response?
- How to test Async Storage with Jest?
- Typescript + React/Redux: Property “XXX” does not exist on type ‘IntrinsicAttributes & IntrinsicClassAttributes