What does %5B and %5D in POST requests stand for?

As per this answer over here: str=”foo%20%5B12%5D” encodes foo [12]: %20 is space %22 is quotes %5B is ‘[‘ and %5D is ‘]’ This is called percent encoding and is used in encoding special characters in the url parameter values. EDIT By the way as I was reading https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURI#Description, it just occurred to me why … Read more

HttpWebRequest and forms authentication in C#

It depends on how the website is authenticating users. If they are using basic authentication or Windows authentication, then you can set the Credentials property of the HttpWebRequest class to the username/password/domain information and it should work. However, it sounds like you have to enter the username/password on the site, which means you are going … Read more

curl Request with ASP.NET

The default HTTP method for WebRequest is GET. Try setting it to POST, as that’s what the API is expecting myReq.Method = “POST”; I assume you are posting something. As a test, I’m going to post the same data from their curl example. string url = “https://YOUR_COMPANY_HERE.beebole-apps.com/api”; string data = “{\”service\”:\”absence.list\”, \”company_id\”:3}”; WebRequest myReq = … Read more

Login to the page with HttpWebRequest

Make a new default.aspx, and put this in the code behind: I cant test any further based on your current question, because you didn’t include a valid username/password. using System; using System.Web; using System.Net; using System.IO; using System.Web.UI; using System.Web.UI.WebControls; namespace Foo { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs … Read more

Maximum concurrent requests for WebClient, HttpWebRequest, and HttpClient

Yes, there is a limit. The default connection limit is 2 concurrent connections per remote host. This can be overridden. For example, I believe that ASP.NET by default overrides the default to be 10 connections per remote host. From https://msdn.microsoft.com/en-us/library/7af54za5.aspx: The number of connections between a client and server can have a dramatic impact on … Read more

C# httpwebrequest and javascript

Just an idea but there is a way to have .net load a webpage as if it were in a browser: using System.Windows.Forms you could Load the webpage into a WebBrowser control WebBrowser wb = new WebBrowser(); wb.ScrollBarsEnabled = false; wb.ScriptErrorsSuppressed = true; wb.Navigate(url); while (wb.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } wb.Document.DomDocument.ToString() This will probably … Read more

How to clear the cache of HttpWebRequest

public static WebResponse GetResponseNoCache(Uri uri) { // Set a default policy level for the “http:” and “https” schemes. HttpRequestCachePolicy policy = new HttpRequestCachePolicy(HttpRequestCacheLevel.Default); HttpWebRequest.DefaultCachePolicy = policy; // Create the request. WebRequest request = WebRequest.Create(uri); // Define a cache policy for this request only. HttpRequestCachePolicy noCachePolicy = new HttpRequestCachePolicy(HttpRequestCacheLevel.NoCacheNoStore); request.CachePolicy = noCachePolicy; WebResponse response = request.GetResponse(); … Read more

C# HttpWebRequest The underlying connection was closed: An unexpected error occurred on a send

In 4.0 version of the .Net framework the ServicePointManager.SecurityProtocol only offered two options to set: Ssl3: Secure Socket Layer (SSL) 3.0 security protocol. Tls: Transport Layer Security (TLS) 1.0 security protocol In the next release of the framework the SecurityProtocolType enumerator got extended with the newer Tls protocols, so if your application can use th … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)