api: switch to post if any post data is given