Skip to content

Extra Slash in URL #339

Open
Open
@sankarcn

Description

@sankarcn

Kindly refer to the below code snippet.
Can you please help me where I am going wrong.
An extra slash is getting added after json.
Seems to be generating a URL like below.
/maps/api/distancematrix/json/?origins=Tabazco+Stora+Gatan+36B+V%C4STER%C5S+722+12&destinations=Puls+Slottsgatan+118+NORRK%D6PING+602+20&units=metric

There is an extra slash added after json. Can you please help figure out where I am doing a mistake.
'Call the distance API to get the distance
GoogleClient.BaseUrl = "https://maps.googleapis.com/maps/api/distancematrix/"
GoogleRequest.Resource = "json"
GoogleRequest.Method = WebMethod.HttpGet
GoogleRequest.RequestFormat = WebFormat.FormUrlEncoded
GoogleRequest.ResponseFormat = WebFormat.Json
GoogleRequest.AddQuerystringParam "origins", OriginAddress
GoogleRequest.AddQuerystringParam "destinations", DestinationAddress
GoogleRequest.AddQuerystringParam "units", "metric"
GoogleRequest.AddQuerystringParam "key", AccessKey

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions