title: Axios get single profile
body: <p>Q) what is correct way to pass id and get "Get"-request by using Axios and Vue.</p>
  
  <p>I have Vue component which has data object and pId -key with value.</p>
  
  <p>I have checked that pId has value.</p>
  
  <p>Profile ID:   {{ pId }}</p>
  
  <p>Gives value 1.</p>
  
  <pre><code>data() {
      return {          
        pId: ''
      }
    },
  methods: { 
      loadProfile(){
          this.status = 'Loading ....';
          axios.get("/profile/${pId} ")
  
          .then(function(response){
             this.profile = response.data.profile;
          })
          .catch(e =&gt; {
          this.errors.push(e)
          })
        },
  init(){
          console.log('Profile mounted');
          EventBus.$on('creds' , key =&gt;{
               [this.pId, this.uId] = key;
          })
  }
    mounted(){
      this.init()
    },
    created: function() {
  
      this.loadProfile();
    }
  </code></pre>
  
  <ul>
  <li>When I pass pId like this:
  <code>axios.get("/profile/${pId} "</code></li>
  <li>URL is: <a href="http://192.168.10.101:8000/profile/" rel="nofollow noreferrer">http://192.168.10.101:8000/profile/</a>$%7BpId%7D</li>
  <li><p>which means that pId is string not value.</p></li>
  <li><p>I have tried this  </p>
  
  <p><code>axios.get("/profile " + this.pId)</code>    </p></li>
  <li><p>which gives me <a href="http://192.168.10.101:8000/profile" rel="nofollow noreferrer">http://192.168.10.101:8000/profile</a></p></li>
  <li><p>without profile id,</p></li>
  <li><p>also tried pass id as parameter, but it is not correct way.</p></li>
  <li><p>if I hard code profile id, I will get profile from Laravel,</p></li>
  <li><p><a href="http://192.168.10.101:8000/profile/1" rel="nofollow noreferrer">http://192.168.10.101:8000/profile/1</a></p></li>
  <li>so route is okey in Laravel side.</li>
  </ul>
  
  <p>thanks Mika.</p>