Hi I have the following code producing an error "The request message was already sent. Cannot send the same request message multiple times."
what is the fix because I assumed the code would work out of box...
`
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Net.Http;
using System.Threading.Tasks;
using Medidata.MAuth.Core;
namespace Medidata
{
public class RequestExample
{
static async Task Main(string[] args)
{
var mauthSigningHander = new MAuthSigningHandler(
new MAuthSigningOptions()
{
ApplicationUuid = new Guid("670e052b-6858-4a34-9b18-4cb44ddfec86"),
PrivateKey = "C:/some/location/on/drive/key.pem"
}
);
var client = new HttpClient(mauthSigningHander);
var request = new HttpRequestMessage(HttpMethod.Get, "https://www.imedidata.com/api/v2/study_groups.json");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Mcc-Version", "v2019-04-12");
var response = await client.SendAsync(request);
response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine("The Response body is the following:");
Console.WriteLine($"{await response.Content.ReadAsStringAsync()}");
Console.WriteLine("\nPress ANY key to exit");
Console.ReadKey();
}
}
}
`
Hi I have the following code producing an error "The request message was already sent. Cannot send the same request message multiple times."
what is the fix because I assumed the code would work out of box...
`
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Net.Http;
using System.Threading.Tasks;
using Medidata.MAuth.Core;
namespace Medidata
{
public class RequestExample
{
}
`