The original was correct. `add_header` won't overwrite if a header is already present -- it's being defaulted to "application/json" on line 31. headers['content-type'] overwrites the preset header.