Want to compare request header value with response value

I have POST request which have request header in key, value pair as “userid”:“ABC”. This field is mandatory to have for successful POST. After successful POST response will again have “userid” as a response body element. I am looking for script which will check/compare header value and response value are same for user id field. Please help.