Question: I developed one dashboard which contains one search button, if i enter some data inside search box that data should be passed to the my backend URL path , based on that url path i have to call my backend API , please help me how to pass the v-model data to my url path .

`Dashboard.vue`

```
<template>
<div class="main">
    <div class="navbar navbar-default navbar-fixed-top">
        <div class="navbar-header">
            <img src="../assets/education.png" alt="notFound" class="education-image" />
        </div>
        <ul class="nav navbar-nav">
            <li>
                <p class="brand">Bookstore</p>
            </li>
        </ul>
        <div class="input-group">
            <i @click="handlesubmit();" class="fas fa-search"></i>
            <div class="form-outline">
                <input type="search" v-model="name" class="form-control" placeholder='search...' />
            </div>
        </div>
 </div>
</div>
</template>
<script>
import service from '../service/User'
export default {

    data() {
        return {
            name:'',

        }
    },
    methods:{
         handlesubmit(){
             let userData = {
               name:this.name,
             }
             service.userSearchByName(userData).then(response=>{
                 this.books.push(...response.data);   
             })
         }
    }

}
</script>

```

`user.js`

```
 userSearchByName(data){
        return axios.getData(`/searchBooksbyName/${}`,data);
    }

```

Answer: 
You have to use the correct HTTP verb (GET/POST) based on what your backend API expects. Use the appropriate methods in axios.

Example using get:

```
 userSearchByName(data){
        return axios.get(`/searchBooksbyName/${data.name}`);
    }

```
**Use proper axios methods to make any request**

Here's a simple solution you can use while making any axios request (POST , GET , PATCH , PUT , DELETE).

```
handlesubmit(){

        const inputQuery = this.name;

       return new Promise((resolve, reject) => {
        axios.get(`/searchBooksbyName/${inputQuery}`)

            .then((response) => {
                if (response){
                 //If you want you can store the value you get in response
                } 

              resolve(response);
              console.log("Get Response", response);

            })
            .catch((error) => {
              if(error){

                //Perform some task here
              }

              console.log(" Error", error);
              reject(error);
            });
    }

```