how to post data using axios with orderBy and with params (here I am using param for authentication to access firebase)
See original GitHub issueI used this code, please tell me how to use in right way-
export function sendRequest(RECEIVERUID, senderUid,TOKEN) {
const request = axios.post(${FIREBASE}/coordinates.json?orderBy=\"uid\"&equalTo=\"${RECEIVERUID}\"
,{
params:{
auth : ${TOKEN}
,
},
data:{
req: senderUid
}
}).then(response => {
console.log([‘request_AddMember’, response.data])
return response.data
}).catch(error => {
console.log(error.message)
})
return {
type: “REQUEST_ADDMEMBER”,
payload: request
}
}
this method is not working. I showing error- Request failed with status code 400
Thanks,
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Retrieving Data | Firebase Realtime Database - Google
The auth request parameter allows access to data protected by Firebase Realtime Database Rules, and is supported by all request types.
Read more >Post request using axios [React and Firebase Tutorial]
Posting Data to Firebase. A nice guide to get started on react and firebase DON'T CLICK THIS: http://bit.ly/-it-is-a-trapGet In Touch: ...
Read more >Firebase OAuth login & data access with axios - Stack Overflow
I am trying to create a sign in using firebase's auth provider functions & then create a user profile in my database using...
Read more >Firebase REST APIs: Loading & Querying Data Simplified 101
This parameter is specially made for dealing with large datasets without any need of downloading everything. Using the Firebase REST API, you ...
Read more >Data Provider - Refine Dev
It will take the API URL as a parameter and an optional HTTP client. We will use axios as the default HTTP client....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this below code is working for method:‘GET’ correctly. But if i use this for method:‘PATCH’
this shows Error: Request failed with status code 400. Please tell me how to solve this.
export function acceptRequest(EMAIL,TOKEN,members){
}
It is a problem that the server can’t response correctly, instead of an issue of axios. Please look for help in stackoverflow.
A quick solution is that checking final url and request headers and comparing with other ways when you can get the right response. If you confirm that axios sends wrong url/headers, feel free to remind me to reopen.