Need some help porting Java code Android Studio to C# Visual Studio : <p>I need some help porting a piece of Java code to C#. The code is about a post request to a web api, to make the connection I used Volley in Java and I've already installed the NuGet in Visual Studio. I have trouble converting a StringRequest function to C#.</p>

<p>This is the piece of code that I'm currently trying to port in C# but I get errors when declaring the params in C#. For example it doesn't recognize the Request.Method and the new Response.Listener.</p>

<pre><code>StringRequest stringRequest = new StringRequest(Request.Method.POST, URL, new Response.Listener&lt;String&gt;()
        {
            @Override
            public void onResponse(String response)
            {
                Log.i("Volley Response", response);
            }
        }, new Response.ErrorListener()
        {
            @Override
            public void onErrorResponse(VolleyError error)
            {
                Log.e("Volley Error", error.toString());
            }
        })

        {
            @Override
            public String getBodyContentType()
            {
                return "application/json; charset=utf-8";
            }

            @Override
            public byte[] getBody()
            {
                try
                {
                    return requestBody.getBytes("utf-8");
                }
                catch (UnsupportedEncodingException uee)
                {
                    return null;
                }
            }
        };
        requestQueue.add(stringRequest);
        return stringRequest;
</code></pre>

<p>If someone could be so nice to help me porting it to C# I would be very happy.</p>
