title: Google API distance matrix with coordinates
body: <p>I am trying to write a code that would fetch destination between two physical points. My request string look like this: </p>
  
  <pre><code>"https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&amp;origins="+initial[0]+"|"+initial[1]+"&amp;destinations="+destination[0]+"|"+destination[1]+"&amp;key="+api_key;
  </code></pre>
  
  <p>As a link it looks like this: </p>
  
  <pre><code>https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&amp;origins=42.9814292|-70.9477546&amp;destinations=51.5073509|-0.1277583&amp;key=
  </code></pre>
  
  <p>The JSON response is </p>
  
  <pre><code>    {
         "destination_addresses" : [ "", "" ],
         "origin_addresses" : [ "", "" ],
         "rows" : [
            {
               "elements" : [
                  {
                     "status" : "NOT_FOUND"
                  },
                  {
                     "status" : "NOT_FOUND"
                  }
               ]
            },
            {
               "elements" : [
                  {
                     "status" : "NOT_FOUND"
                  },
                  {
                     "status" : "NOT_FOUND"
                  }
               ]
            }
         ],
         "status" : "OK"
      }
  </code></pre>
  
  <p>When tried without "|" the response is </p>
  
  <pre><code>    {
     "destination_addresses" : [ "51.5073509,-0.1277583" ],
     "origin_addresses" : [ "42.9814292,-70.9477546" ],
     "rows" : [
        {
           "elements" : [
              {
                 "status" : "ZERO_RESULTS"
              }
           ]
        }
     ],
     "status" : "OK"
  }
  </code></pre>
  
  <p>Where exactly is the problem? I know that it has to be the coordinates and how i put them into url but I don't understand what I have to change.</p>