I have curl command:
curl -i -u guest:guest -H \"content-type:application/json\"
-XPUT \\ http://localhost:15672/api/traces/%2f/my-trace \\
-d\'{\"format\":\
two problems that i can see:
also, when you do userpass.getBytes()
you are getting the bytes using the default platform character encoding. this may or may not be the encoding that you desire. better to use an explicit character encoding (presumably the one the server is expecting).