.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Web;
					
public class Program
{
	public static void Main()
	{
		// Client
		var foo = new AuthEndPointArgs { ResponseType = "code", ClientId = "a:b" };
		var json = JsonSerializer.Serialize(foo);
		var payload = HttpUtility.UrlEncode(json);
		
		// Server
		json = HttpUtility.UrlDecode(payload);
		var recvd = JsonSerializer.Deserialize<AuthEndPointArgs>(json);
		Console.WriteLine(recvd.ResponseType);
		Console.WriteLine(recvd.ClientId);
	}
	
	class AuthEndPointArgs
	{
		[JsonPropertyName("response_type")]
		public string ResponseType { get; set; }
		
		[JsonPropertyName("client_id")]
		public string ClientId { get; set; }
	}
}
;