I know how to parse post data in golang
r.ParseForm()
pid := r.PostFormValue("pid")
code := r.PostFormValue("code")
lang := r.PostFormValue("lang")
author := r.PostFormValue("author")
But the post data is pid=1&code=#include <stdio.h>\x0Aint main()\x0A{\x0A\x09printf(\x223\x5Cn\x22);\x0A\x09return 0;\x0A}&lang=c&author=11
(this is obtained from nginx log)
So when I parse the data, it could be wrong. The parsed data of code
is
#include <stdio.h>
int main()
{
printf("3
")
instead of
#include <stdio.h>
int main()
{
printf("3
");
return 0;
}
So how can I fix this problem?