Improve put() function

So that put() supports data not only array e.g. json, text, etc.