Fix request headers and data
Replace opts to be a hashref instead of hash