title: .NET Core 2.0: Only 'http' and 'https' schemes are allowed. Parameter name: requestUri
body: <p>sI have a Web API built using ASP.NET Core 2.0. I am trying to make a call to Firebase Cloud Messaging HTTP v1 to send a push notification to the mobile client. As per documentation, you need to make a call to this endpoint: </p>
  
  <blockquote>
    <p>POST <a href="https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send" rel="nofollow noreferrer">https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send</a></p>
  </blockquote>
  
  <p>When I try making this call (with my token) I get an error message about only http and https being allowed: </p>
  
  <blockquote>
    <p>Only 'http' and 'https' schemes are allowed. 
    Parameter name: requestUri</p>
  </blockquote>
  
  <p>This error message makes me think HttpClient has a problem with the :send part of the Uri. Here is the code I wrote to do this: </p>
  
  <pre><code>HttpClient client = new HttpClient();
  client.BaseAddress = new Uri("https://fcm.googleapis.com/v1/projects/my-project-id/");
  client.DefaultRequestHeaders.Accept.Clear();
  client.DefaultRequestHeaders.Authorization = new 
  System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token);
  client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
  var jsonMessage = JsonConvert.SerializeObject(message);
  var stringConent = new StringContent(jsonMessage, System.Text.Encoding.UTF8, "application/json");
  var fcmCall = await client.PostAsync("messages:send", stringConent);
  </code></pre>
  
  <p>What could I try to solve this issue? Many thanks. </p>
  
  <p>Link to FCM: <a href="https://firebase.google.com/docs/cloud-messaging/send-message" rel="nofollow noreferrer">https://firebase.google.com/docs/cloud-messaging/send-message</a> </p>