Refactored code to only include the content headers if POST/PUT since they are they are the only ones with content