2

I am trying for a way to pass binary data to a server over http, via the URL field in the browser. Is there a way to bypass the automatic http encoding done by the browser so I can just encode the data by myself.

e.g.: Instead of the byte with value 48, to fill in the URL %30 so that the browser doesn't re-encode the url and I end up with %2530

Solved: To whom may encounter similar problems in the future. You can do so by using wget parameter

--restrict-file-name=ascii

Which basically ensures that '%' won't be escaped

skyel
  • 713
  • 1
  • 6
  • 20
  • Why do you need to do the encoding yourself? – Overv May 26 '12 at 12:02
  • Because on the server side there is a binary that expects this sort of data, and I was wondering whether there was a way to do this without writing a http client from scratch. – skyel May 26 '12 at 12:08
  • If you just put a `0` in, that's equivalent to putting `%30`. There shouldn't be any issues doing so. – Asherah May 26 '12 at 12:11
  • As e.g. suggests, that was a mere example. There are ways to do so for the first 127 ASCII characters (the readable ones) but the problem is with the ones in range (127-255] – skyel May 26 '12 at 12:15

3 Answers3

2

Use base64 encoding, that's what it's designed to do.

Julien Lebot
  • 3,092
  • 20
  • 32
  • He can't modify the server side, so no option. Skyel, you should put that in the question. – Overv May 26 '12 at 12:45
  • This may cause issues becaue the base64 encoded string can contain '/'. I think base32 encoding is more appropriate. – zwcloud Aug 17 '16 at 15:56
0

I managed to do so, by writing my own tcp client to connect to the http server and transmit the request, by inputting it manually.

skyel
  • 713
  • 1
  • 6
  • 20
0

Use the base62 encoding.

The encoded string doesn't contain any character that will be URL-encoded.

Community
  • 1
  • 1
zwcloud
  • 4,546
  • 3
  • 40
  • 69