support both POST and GET