#NEWLINE# def post_json( self , url , data , raw = False ) : #NEWLINE# #INDENT# 'Helper method to send JSON POST requests.\n\n        Usage:\n\n            self.post_json(\'/some/url\', dict(param=value))\n            self.post_json(\'/some/url\', \'{"param": "value"}\', raw=True)\n\n        Args:\n            url: Target URL.\n            data: Request payload. It maybe a dict or string with raw content.\n            raw: If ``True`` then do not convert ``data`` to JSON string and use\n                 it as is.\n\n        Returns:\n            flask_json.JsonTestResponse\n        ' #NEWLINE# content = ( data if raw else json . dumps ( data ) ) #NEWLINE# headers = [ ( 'Content-Type' , 'application/json' ) , ( 'Content-Length' , len ( content ) ) ] #NEWLINE# return self . client . post ( url , headers = headers , data = content )