I am trying to parse a really simple json string in python but am getting a malformed string error. I know that it is a type string (see below), so this is not the problem Why does this string not work with ast.literal_eval
Why else might I get this error? How can I fix it?
g = "{\"RequestType\":\"1\" , \"FileName\":\"" + "test" + "\" }"
print type(g) //prints string
d = ast.literal_eval(json.loads(g)) //throws malformed string error