Send a POST request. This wrapper sets the `application/json` content type which is more suitable for standard GraphQL requests and doesn't mismatch with handling multipart requests in Graphene.
(self, data=None, **kwargs)
| 61 | self.token = get_token(user) |
| 62 | |
| 63 | def post(self, data=None, **kwargs): |
| 64 | """Send a POST request. |
| 65 | This wrapper sets the `application/json` content type which is |
| 66 | more suitable for standard GraphQL requests and doesn't mismatch with |
| 67 | handling multipart requests in Graphene. |
| 68 | """ |
| 69 | if data: |
| 70 | data = json.dumps(data, cls=DjangoJSONEncoder) |
| 71 | kwargs["content_type"] = "application/json" |
| 72 | return super().post(API_PATH, data, **kwargs) |
| 73 | |
| 74 | def post_graphql( |
| 75 | self, |
no outgoing calls
no test coverage detected