I am trying to create an account on the stellar Test Network. I am using ASP .Net framework. But whenever I make a request and pass in the public key, I always get this error:
Response status code does not indicate success: 400 (Bad Request)
.
I'll add that I am using the Javascript documentation from here and converting it to C# code because I didn't find any documentation for C#. Is there anything I'm missing out?
this is how the code looks:
try {
string url = "https://friendbot.stellar.org?addr=" + Uri.EscapeDataString(pair.PublicKey);
HttpResponseMessage response = await client.GetAsync(url);
string responseBody = await client.GetStringAsync(url);
object responseObject = JsonConvert.DeserializeObject<object>(responseBody);
return Ok(responseObject);
} catch(Exception ex) {
return BadRequest("Could not Establish a successful connection with Stellar because " + ex.Message);
}