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

4
  • Why do you need to do the encoding yourself? Commented May 26, 2012 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. Commented May 26, 2012 at 12:08
  • If you just put a 0 in, that's equivalent to putting %30. There shouldn't be any issues doing so. Commented May 26, 2012 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] Commented May 26, 2012 at 12:15

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

He can't modify the server side, so no option. Skyel, you should put that in the question.
This may cause issues becaue the base64 encoded string can contain '/'. I think base32 encoding is more appropriate.
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.

Comments

0

Use the base62 encoding.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.