Questions tagged [urlencode]

To “URL encode” or “percent encode” text means to encode it for use in a URL. Some characters are not valid when used as-is in URLs, and so much be URL-encoded (percent-encoded) when appearing in URLs.

https://url.spec.whatwg.org/#percent-encoded-bytes is the section of the current URL standard that defines percent encoding (URL encoding).

2314 questions
23
votes
1 answer

How to set the "Content-Type ... charset" in the request header using a HTML link

I have a simple HTML-page with a UTF-8 encoded link. search for "ü"
HAL 9000
  • 3,877
  • 1
  • 23
  • 29
23
votes
2 answers

How to make RabbitMQ API calls with vhost "/"?

The following API call to RabbitMQ: http -a USER:PASS localhost:15001/api/queues/ Returns a list of queues: [ { ... "messages_unacknowledged_ram": 0, "name": "foo_queue", "node": "rabbit@queue-monster-01", …
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
23
votes
4 answers

URL component encoding in Node.js

I want to send http request using node.js. I do: http = require('http'); var options = { host: 'www.mainsms.ru', path: '/api/mainsms/message/send?project='+project+'&sender='+sender+'&message='+message+'&recipients='+from+'&sign='+sign …
Kliver Max
  • 5,107
  • 22
  • 95
  • 148
23
votes
2 answers

Java URL encoding: URLEncoder vs. URI

Looking on the W3 Schools URL encoding webpage, it says that @ should be encoded as %40, and that space should be encoded as %20. I've tried both URLEncoder and URI, but neither does the above properly: import java.net.URI; import…
John Farrelly
  • 7,289
  • 9
  • 42
  • 52
21
votes
5 answers

How to send array with CURL? Should I `urlencode` it?

When I assign an array of data to be POSTed as a cURL option (via CURLOPT_POSTFIELDS), do I need to urlencode that data first or will that be taken care of?
Uberfuzzy
  • 8,253
  • 11
  • 42
  • 50
21
votes
3 answers

HttpServerUtility.UrlTokenEncode replacement for netstandard

I'm porting a project targeting net472 to netstandard. The last System.Web dependency I'm stuck with is HttpServerUtility.UrlTokenEncode(Byte[]). I found Microsoft.AspNetCore.WebUtilities, which contains Base64UrlTextEncoder and WebEncoders, but…
m0sa
  • 10,712
  • 4
  • 44
  • 91
21
votes
2 answers

How to decode a (doubly) 'url-encoded' string in python

Tried decoding a url-encoded string in the following way some_string = 'FireShot3%2B%25282%2529.png' import urllib res = urllib.unquote(some_string).decode() res u'FireShot3+%282%29.png' Original string is FireShot3 (2).png. Any help would be…
user1986059
  • 433
  • 1
  • 3
  • 11
21
votes
2 answers

How to pass multiple values for a single URL parameter?

Is it possible to pass multiple values for a single URL parameter without using your own separator? What I want to do is that the backend expects an input parameter urls to have one or more values. It can me set to a single or multiple URLs. What is…
Cory
  • 14,865
  • 24
  • 57
  • 72
20
votes
3 answers

URL/HTML escaping/encoding

I have always been confused with URL/HTML encoding/escaping. I am using PHP, so I want to clear some things up. Can I say that I should always use urlencode: for individual query string parts $url = 'http://test.com?param1=' . urlencode('some…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
20
votes
2 answers

How to encode URL parameters in QT?

I have the following URL QString url = "http://www.gigacooldomainname.com/" + setName + "/" + fileName + ".jpg" where setName and fileName are QString variables. I wish to have the following: QString url = "http://www.gigacooldomainname.com/" +…
Gad D Lord
  • 6,620
  • 12
  • 60
  • 106
19
votes
2 answers

How to do url encoding for query parameters in Kotlin

I am new to Kotlin & I am trying to url encode my url which has query parameters. private const val HREF = "date?July 8, 2019" private const val ENCODED_HREF = print(URLEncoder.encode(HREF, "utf-8")) private const val URL =…
Mia
  • 191
  • 1
  • 1
  • 8
19
votes
4 answers

In Ruby/Rails, how can I encode/escape special characters in URLs?

How do I encode or 'escape' the URL before I use OpenURI to open(url)? We're using OpenURI to open a remote url and return the xml: getresult = open(url).read The problem is the URL contains some user-input text that contains spaces and other…
jpw
  • 18,697
  • 25
  • 111
  • 187
19
votes
4 answers

Convert spaces to %20 in list

I need to convert spaces to %20 for api posts in a python array tree = et.parse(os.environ['SPRINT_XML']) olp = tree.findall(".//string") if not olp: print colored('FAILED', 'red') +" No jobs accociated to this view" exit(1) joblist = [t.text…
user2363318
  • 1,039
  • 1
  • 12
  • 31
18
votes
6 answers

urlencode() from PHP in JavaScript?

I'm looking for similar function as urlencode() from PHP just in JavaScript. jQuery library is allowed. Basically, I need to encode the string and then redirect the user to another page just with JavaScript.
daGrevis
  • 21,014
  • 37
  • 100
  • 139
18
votes
6 answers

How can I stop the browser from url-encoding form values on GET

I have a form with method="get". In the form I need to pass the URL of a CSS file but it is encoding it to http%3A%2F%2Fwww... etc. Is there a way to stop the encoding of the URL as it is breaking the file. Thanks
kristina
  • 181
  • 1
  • 1
  • 3