Replies: 27 comments 2 replies
-
Coming from #604. I don't thing this should be an option. If it is it the default for encoding should be 100% standard compliant. If you follow RFC 100% and not encode anything extra for no reason, that would cover my use-case of messed up query string. As an API developer tool Insomnia should strive to be 100% standard compliant and do exactly as I tell it too (as a developer) any magic that happens without my knowledge is not acceptable. As a side note, I was too quick to point out that Postman works (Chrome version did). I filed this bug yesterday: postmanlabs/postman-app-support#3816 Same problem really just picks different characters to encode 🤷♂️ |
Beta Was this translation helpful? Give feedback.
-
I totally agree that Insomnia should follow the standard as closely as possible. However, the unfortunate reality is that changing the default would break the application for too many users. There must be a way to preserve the current behavior for all existing users of the app. An option would satisfy this requirement. After thinking about this for a while, I have a few more thoughts. Having an option configurable at the workspace-level could allow the app to set auto-encoding "on" for existing workspaces and "off" for new ones. This would mean that all new users would not experience auto-encoding by default. And, it would also mean that workspaces shared via the export and sync would preserve the auto-encoding behavior from where they were exported. |
Beta Was this translation helpful? Give feedback.
-
I'd prefer going to standards-based behaviour too, and that option (set for old projects, unset for new) sounds like a sensible migration path to me. I imagine the per-parameter on/off setting would be a nice option in cases where I did need to think about intentionally encoding characters further. It's hard to judge if anybody actively needs that right now, mainly because it's currently the default, but if that is a substantial use case then that sounds like nice UX for it imo. |
Beta Was this translation helpful? Give feedback.
-
I'd like to chime in and voice my support for the ability to turn on and off encoding for query parameters. Elastic search query strings require colons to be passed in unencoded, so the query editor in Insomnia is rendered fairly unusable for that usecase. I recognize this is just one example, but I think there are perhaps many users of Elastic search's querystring feature that could also benefit from Insomnia's query editor. |
Beta Was this translation helpful? Give feedback.
-
I think it's important to recognise that query parameters are not part of URI standard: https://tools.ietf.org/html/rfc3986 Although query name value pairs are common, they are not mandated by this standard (this is my use case, I don't use name value pairs and strange things happen in Insomnia). The name value pairs actually come from HTML standard for form encoding: https://www.w3.org/TR/html401/interact/forms.html#form-content-type The following is the behaviour I'd prefer:
|
Beta Was this translation helpful? Give feedback.
-
+1 for this feature request... 👍 |
Beta Was this translation helpful? Give feedback.
-
+1 for adding an encoding on/off switch in the query params builder. I have the same use case as @Charlex , working with elasticsearch URI strings is not possible when Insomnia automatically encodes everything. |
Beta Was this translation helpful? Give feedback.
-
+1 to the above query; I need to pass soql query as query param delimited by |
Beta Was this translation helpful? Give feedback.
-
Disable Request URL Encoding
@osamakhn @jaldinger @jperezlatimes @oliverjanik @gschier |
Beta Was this translation helpful? Give feedback.
-
Thanks @roblav96 ! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Correct, it does not apply to anything placed inside the Query tab. I actually don't even remember why I added that option, as it doesn't seem very useful looking at it now. |
Beta Was this translation helpful? Give feedback.
-
@gschier Thoughts on this preferance being placed in workspace settings? So far out of the 6 months I've been using Insomnia daily, this is the first con so not to worry, it's still by far the best rest api client to date! Keep up the amazing work! =] |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feature, but I was working on a Rest API which had query parameters like "A+B+C". In Insomnia, the auto encoding option is "On" by default. So, when I tested the API using Insomnia it converted "+" to "%2B" and my rest APIs worked correctly in the way i wanted them to. But all the others tools don't encode "+" and there it is failing. Now, I might have to restructure my API or change the encoding of the requests received. |
Beta Was this translation helpful? Give feedback.
-
Can we have this Off for any new request? It's absolutely crazy to have non-standard behaviour as default. |
Beta Was this translation helpful? Give feedback.
-
Is there any workaround to turn off the url-encoding on Query tab? |
Beta Was this translation helpful? Give feedback.
-
+1 for disabling automatic encoding of query params. I'm working with a somewhat-awkward real estate API, where we need to send params that are literally (e.g.): ^ Right now this can't be done in Insomnia (or so far as I can tell). |
Beta Was this translation helpful? Give feedback.
-
@ian-schu OData, how I don't miss it! 😅 I am using Insomnia to poke at external APIs I am integrating with, so it is just plain wrong to force Insomnia to be 100% standards compliant. There are a lot of shitty APIs out there doing non-standard things, I still need to create integrations against them :) For creating an API yourself, I agree - then you want strict validation of everything to ensure correctness. I probably have to drop down to curl for testing some shitty APIs, would much prefer to use Insomnia instead! |
Beta Was this translation helpful? Give feedback.
-
Another vote for disabling encoding of query parameters. I'm trying to debug an API with a search parameter that won't accept encoding. |
Beta Was this translation helpful? Give feedback.
-
Since the issue here is still open - It would be awesome if we are able to URL encode/decode tag values as well. I have a use case where I get an encrypted and base64 encoded XSRF token as a cookie. In cases where the base64 string is padded with |
Beta Was this translation helpful? Give feedback.
-
+1 for adding an encoding on/off switch in the query params builder. |
Beta Was this translation helpful? Give feedback.
-
+1 for penetration testing |
Beta Was this translation helpful? Give feedback.
-
A feature for sending "raw" URL query string values without having them encoded by Insomnia would be nice. I'm having problems getting Insomnia to send the query string "?p=%257b%2522". Using the raw value "%257b%2522" does not work since Insomnia decodes %25 into % and sends "?p=%7b%22". |
Beta Was this translation helpful? Give feedback.
-
+1 for sending raw characters from the query params |
Beta Was this translation helpful? Give feedback.
-
Okay, this is a little silly. I straight up cannot put a + into the query parameter value and therefore the Server refuses the request because Insomnia encodes it as %2B and there is no way to change it. What gives this might not be standard but it's not the first time that I have come across this kind of behavior and the fact that I am entirely unable to use Insomnia is doing my head in right now. There absolutely should be settings to enable/disable encoding for each part of the request or the request as a whole. Probably even good for the whole workspace and user too |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
WSO2 APIs depend on unencoded special characters in query parameters, so I can not test those with Insomnia. I've encountered this requirement in other APIs as well in the past. I don't really understand why there still is no option to turn off auto-encoding in query parameters. |
Beta Was this translation helpful? Give feedback.
-
Related to #592 and #604
Problem Description
From day 1, Insomnia has always automatically encoded path and query segments in the URL. The initial reason for this was to preserve compatibility with the legacy version of Insomnia (Chrome App) where the URLs were automatically encoded by the Chrome network layer.
For a lot of users, this auto-encoding causes problems and the severity is amplified by the fact that it is actually impossible to send non-encoded special characters.
Potential Solutions
There are a number of ways this can be solved. Please let me know which one you think is best:
Beta Was this translation helpful? Give feedback.
All reactions