How can i use your API in front POST?
See original GitHub issueHi guys. Thank you very much for good job. It’s very good API. But i’m a noob in FrontEnd and can’t understand how i can use your API. I mean. First question : What different between /public and /private? Second : i have code in my VUE client
import axios from 'axios';
export default {
data () {
return {
form: {
username: '',
password: '',
},
}
},
methods: {
onSubmit (evt) {
evt.preventDefault()
// this.$router.push('/home')
axios.post(`http://localhost:3003/api/login`, this.form)
.then(response => {
// JSON responses are automatically parsed.
this.form = response.data
sessionStorage.setItem('token',response.data.token);
this.$router.push('/home')
})
.catch(e => {
console.log(e)
})
}
}
And i have troubles only with Login. Auth service work good. What i have to do for use your api? Can’t understand. Sry for my noobs qust. And thank you for listening. P.S. and ofc. sry for bad eng, from Russia.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Making Use of APIs in Your Front End | by Patrick Pierre
So in this post, I am going to help you learn more about APIs and how you can use them through a simple...
Read more >The Ultimate Guide to Accessing & Using APIs - HubSpot Blog
An API call also comprises everything that happens after the ... to build an app and put it in front of thousands of...
Read more >How to Do an API Integration: Beginners Guide [w - Snipcart
With each HTTP request created, there is always an 'HTTP Verb' that goes along with it. The most commons are GET , POST...
Read more >How To Use an API with JavaScript (Beginner's Guide ...
In order to find JAAS API section, enter its name in the search box in the RapidAPI service or go to the “Data”...
Read more >How to securely call an authenticated API from your front end
Your front end needs to access data from an API which requires an API key. If you put this API key in your...
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
Dude, you helped me very much when I answered the second time) I want to close the question, but did not understand how. Sorry. I did everything, everything works fine, thank you very much)
i do not really understand the question…
but you are using here the username as key for the data you post to the server… you should change username to email, but maybe you have to change something in your app somewhere else too…