Skip to main content
added 18 characters in body
Source Link
Alex K.
  • 176.8k
  • 32
  • 276
  • 299

I am trying to pass a string into a url in C#:

using (var client = new WebClient()) { var responseStr = client.DownloadString("http://api.openweathermap.org/data/2.5 /weather?q=Groningen,nl&APPID=%207b030ffcc7338cc5f1adc4ca8e6205aa");
}

using (var client = new WebClient()) { var responseStr = client.DownloadString("http://api.openweathermap.org/data/2.5 /weather?q=Groningen,nl&APPID=%207b030ffcc7338cc5f1adc4ca8e6205aa"); } 

I there a way to pass a string variable, instead of ?q=Groningen So I could use a text field to get the weather of a city.

I could not find the answer.

Thank you

I am trying to pass a string into a url in C#:

using (var client = new WebClient()) { var responseStr = client.DownloadString("http://api.openweathermap.org/data/2.5 /weather?q=Groningen,nl&APPID=%207b030ffcc7338cc5f1adc4ca8e6205aa");
}

I there a way to pass a string variable, instead of ?q=Groningen So I could use a text field to get the weather of a city.

I could not find the answer.

Thank you

I am trying to pass a string into a url in C#:

using (var client = new WebClient()) { var responseStr = client.DownloadString("http://api.openweathermap.org/data/2.5 /weather?q=Groningen,nl&APPID=%207b030ffcc7338cc5f1adc4ca8e6205aa"); } 

I there a way to pass a string variable, instead of ?q=Groningen So I could use a text field to get the weather of a city.

I could not find the answer.

Thank you

Source Link
BlueCastle
  • 217
  • 2
  • 8
  • 19

How to pass a variable in url in c#

I am trying to pass a string into a url in C#:

using (var client = new WebClient()) { var responseStr = client.DownloadString("http://api.openweathermap.org/data/2.5 /weather?q=Groningen,nl&APPID=%207b030ffcc7338cc5f1adc4ca8e6205aa");
}

I there a way to pass a string variable, instead of ?q=Groningen So I could use a text field to get the weather of a city.

I could not find the answer.

Thank you