Trim whitespace from json POST buffer