Use gitlab api create empty file return 400 Bad Request

I use gitlab api with golang and create some empty file like this:

{“branch_name”:“master”,“commit_message”:“add xxxsupervisor/.keep”,“content”:" \n",“encoding”:“text”,“file_path”:“codis/xxxxxxx/supervisor/.keep”,“private_token”:“xxxxxxxxxxxxxxxxxxxxxx”}

but return:

400 Bad Request

then i add 1 in content, and it works:

{“branch_name”:“master”,“commit_message”:“add xxxsupervisor/.keep”,“content”:" 1\n",“encoding”:“text”,“file_path”:“codis/xxxxxxx/supervisor/.keep”,“private_token”:“xxxxxxxxxxxxxxxxxxxxxx”}

201 Created

if i do something wrong? the gitlab api can not support create empty file?