postResource and putResource encode stringify the given objects