Note that there are some explanatory texts on larger screens.

plurals
  1. POFoursquare SDK for .net
    primarykey
    data
    text
    <p>may i know is there any foursquare sdk for .NET C#. I am doing based on the developer reference but i failed to do it during request for token, i keep on getting the error. I am using VS 2008 and under development server. I search before this error because of url rewriting, but i'm not hosted in IIS and i also have check the web.config, no luck also. Please help, thanks.</p> <p>This is my error:</p> <p><strong>The HTTP verb POST used to access path '/login' is not allowed.</strong></p> <p>This is my implementation:</p> <pre><code> HttpWebRequest request = null; HttpWebResponse response = null; StreamReader responseStream = null; ASCIIEncoding ascii = null; string key = ConfigurationManager.AppSettings["key"]; string secret = ConfigurationManager.AppSettings["secret"]; string callback = ConfigurationManager.AppSettings["callback"]; string obtainTokenUrl = ConfigurationManager.AppSettings["obtainTokenUrl"]; try { string postData = "client_id=" + key + "&amp;response_type=code&amp;redirect_uri=" + callback; ascii = new ASCIIEncoding(); byte[] postBytes = ascii.GetBytes(postData); try { request = WebRequest.Create(obtainTokenUrl) as HttpWebRequest; } catch (UriFormatException) { request = null; } if (request == null) { throw new ApplicationException("Invalid URL: " + obtainTokenUrl); } request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = postBytes.Length; //add post data to request Stream postStream = request.GetRequestStream(); postStream.Write(postBytes, 0, postBytes.Length); postStream.Close(); response = (HttpWebResponse)request.GetResponse(); Encoding encode = Encoding.GetEncoding("utf-8"); responseStream = new StreamReader(response.GetResponseStream(), encode); Response.Write(responseStream.ReadToEnd()); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload