Properly encode body and catch invalid configs