I think this is a good fix for now.

It seems a little weird that we have to do this encoding here.  It seems like it's really something that should be handled in the HTTP client layer but I think we would have to do a fair amount of refactoring to do that.