query-string

QueryString converting %E1 to %ufffd

若如初见. 提交于 2020-01-04 02:56:06
问题 I have a URL like the following http://mysite.com/default.aspx?q=%E1 Where %E1 is supposed to be á . When I call Request.QueryString from my C# page I receive http://mysite.com/default.aspx?q=%ufffd It does this for any accented character. %E1, %E3, %E9, %ED etc. all get passed as %ufffd . Normal encoded values ( %2D , %2E , %27 ) all get passed correctly. The config file already has the responseEncoding / requestEncoding in the globalization section set to UTF-8. How could I read the correct

Does IIS7 log request query string by default?

一世执手 提交于 2020-01-04 01:59:04
问题 Our analytics engine reads IIS logs and I want to know if the query string is included in these, in a default IIS7 setup. For example, if a user requests http://mysite.com/page?to=otherpage will the logs contain http://mysite.com/page?to=otherpage or http://mysite.com/page ? 回答1: In the Logging settings for the Server or a specific site (I usually configure logging globally), provided you've selected the URI Query (cs-uri-query) logging field then IIS will log the query string: You can enable

Binding querystring values to a dictionary

风格不统一 提交于 2020-01-03 12:34:49
问题 I'm using Web API (part of ASP.NET MVC 5), and I'm trying to bind querystring values to a Dictionary<int, bool> . My Web API method is simply: [HttpGet] [Route("api/items")] public IQueryable<Item> GetItems(Dictionary<int, bool> cf) { // ... } If I try to invoke this URL: /api/items?cf[1009]=true&cf[1011]=true&cf[1012]=false&cf[1015]=true The parameter cf is always null . How can I pass in a dictionary of values via the QueryString to a Web API method? 回答1: When you want to pass a dictionary

How to download an image using a URL with a query string instead of image path?

主宰稳场 提交于 2020-01-03 05:26:21
问题 I'm doing a C# windows application, and need to know how to download a picture which has a link with a query string, for example www.mywebsite.com/img.aspx?imgid=12345 (which automatically redirects to the appropriate image based on imgid ). I need to then save the file to the disk somewhere. I don't need any big fancy download manager, just the cleanest way to get such an image from a redirecting URL. 回答1: You should be able to do it like this: using (WebClient Client = new WebClient ()) {

Long query string variable missing

别等时光非礼了梦想. 提交于 2020-01-03 00:27:28
问题 I've got a pretty long query string variable (value is approximately 600 chars) that I'm trying to reach from a PHP script. The long one is not present in $_REQUEST or $_GET but another variable with shorter value length is. I've shaved off some of it to test and it starts going missing when the value is at 549 chars or more. Fortunately the long variable is present in $_SERVER["QUERY_STRING"] so for now I'm just picking it up from there, but was curious as to if this is a server setting

Max querystring length on asp .net 2.0

。_饼干妹妹 提交于 2020-01-02 04:51:14
问题 I am working on ASP .NET version 2.0 and IIS 6. I am calling a pop up aspx page from the main page by calling its URL and passing querystring to it. For a specific case the length of my querystring exceeds more than 2000 characters. So the pop up screen opens up fine for the first time but whenever there is a postback in that pop up screen, I get a internet connection error. I am sure this is happening because of the large length of the querystring because it works fine when I reduce the

How to use Routing ASP.NET 4 WebForms with Query String?

跟風遠走 提交于 2020-01-01 09:18:53
问题 First, this is not MVC, WebForms only.. I'm using routing to keep my site backwards compatible for our clients, while make my project organized. I'm also thinking of moving our encrypted query string to a more friendly url. How this works is our clients have to bookmark a huge encrypted url to prevent them from guessing our other clients by changing an id around. But instead of having this huge url, wanted to add a route like LoginClientName.aspx for each client and have the encrypted query

Where's the HttpUtility.ParseQueryString Method in WinRT?

老子叫甜甜 提交于 2020-01-01 02:45:18
问题 Since HttpUtility is not available in WinRT, I was wondering if there's a straightforward way to parse HTTP query strings? Is there actually some equivalent to HttpUtility.ParseQueryString in WinRT? 回答1: Instead of HttpUtility.ParseQueryString you can use WwwFormUrlDecoder. Here's an example I grabbed here using System; using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; using Windows.Foundation; [TestClass] public class Tests { [TestMethod] public void TestWwwFormUrlDecoder() { Uri

How to convert JSON to query string in angular2?

▼魔方 西西 提交于 2019-12-31 21:56:45
问题 I'm new to Angular2. I have a JSON object, as below: var options = { param1: "parama1", param2: "parama2", param3: "parama3" }; which should convert to query string and append to an external URL to redirect the page like below: ngOnInit(){ window.location.href = someurl?param1=param1&param2=param2&param3=param3; } I'm looking for a way to convert it to query string. In JQuery, $.param() and in AngularJS $httpParamSerializerJQLike() are there for this. I'd searched, but I got nothing. I want

Remove query string “?” in HTML form method GET

随声附和 提交于 2019-12-31 05:43:28
问题 I have a simple search form of Google Images that open in a new window. When I want to change the form parameters to Unsplash (that don't use query strings on their URL search) the form continue sending query string ;( HTML <input type="radio" id="google" name="image" onclick="googleImages();" checked/> <label for="google">Google Images</label> <input type="radio" id="unsplash" name="image" onclick="unsplash();"/> <label for="unsplash">Unsplash</label> <form id="form" method="GET" action=