Affter got request with payload first i have validate is it correct json are not then if print r.Body it will getting empty befoure i writte r.Body without validation it work fine
The validation routine reads everything from r.Body. After ioutil.ReadAll has completed, r.Body is empty (because everything was read from it).
You don’t need to validate the JSON separately. Unmarshal it directly to wherever it needs to go. If there is a problem, json.Unmarshal will return an error that you can then handle.