It's probably not very apparent from our HTTP API docs but there're different endpoints for SPARQL Update queries (/{db}/update) and SPARQL Graph Store Protocol (/{db}). You're using the former and it expects a query, not data. It looks like you need PUT Graph or Post Graph instead. There the payload is data in some RDF serialisation, like Turtle.