Get a JSON-ready representation of this HtmlContent.

        :returns: This HtmlContent, ready for use in a request body.
        :rtype: dict
487635
def get(self):
        
        content = {}
        if self.mime_type is not None:
            content["type"] = self.mime_type

        if self.content is not None:
            content["value"] = self.content
        return content
726170
def to_json(self, indent=None, sort_keys=True):
        
        return json.dumps(self.to_dict(), indent=indent, sort_keys=sort_keys)
18276
def tojson(self) -> str:
        
        return json.dumps({
            'event_id': str(self.id),
            'event_type': self.type,
            'schema_name': self.schema_name,
            'table_name': self.table_name,
            'row_id': self.row_id
        })
434460
def to_json(self):
        
        endpoints = []
        for endpoint in self.endpoints:
            list_fields = endpoint.fields
            resource_type = endpoint.Meta.resource_type
            table = endpoint.Meta.table

            data = endpoint.to_dict()
            data['fields'] = resource_type.get_type_of_fields(
                list_fields,
                table,
            )
            endpoints.append(data)

        data = {
            'title': self.title,
            'endpoints': sorted(endpoints, key=lambda x: x['name']),
        }

        return json.dumps(data)
700570
def json(self):
        

        if self.fresh():
            return self.__cached_json
        # noinspection PyAttributeOutsideInit
        self.__last_read_time = time.time()
        self.__cached_json = self._router.get_instance(org_id=self.organizationId, instance_id=self.instanceId).json()

        return self.__cached_json
767746
def json(self):
        
        try:
            return self._json
        except AttributeError:
            try:
                self._json = json.loads(self.text)
                return self._json
            except:  # noqa e722
                raise RequestInvalidJSON("Invalid JSON received")
726158
def serialize(self, content):
        
        content = super(JSONPEmitter, self).serialize(content)
        callback = self.request.GET.get('callback', 'callback')
        return u'%s(%s)' % (callback, content)
138889
def to_json(self, pretty=True):
        
        data_dict = self.to_dict()
        if pretty:
            return json.dumps(
                data_dict, sort_keys=True, indent=2)
        return json.dumps(data_dict, sort_keys=True)
1330999
def asJSON(self):
        
        value = self._json
        if value is None:
            value = json.dumps(self.asDictionary,
                               default=_date_handler)
            self._json = value
        return self._json
1172814
def getJson(cls, url, method='GET', headers={}, data=None, socket=None, timeout=120):
        
        if not 'Content-Type' in headers:
            headers['Content-Type'] = ['application/json']

        body = yield cls().getBody(url, method, headers, data, socket, timeout)

        defer.returnValue(json.loads(body))
229678
public function getJsonContent()
    {
        if ($this->jsonContent === null) {
            try {
                if (($content = $this->content) === '') {
                    return $this->jsonContent = false;
                }

                $this->jsonContent = json_decode($content, true);
            } catch (\Exception $exception) {
                return $this->jsonContent = false;
            }
        }

        return $this->jsonContent;
    }
400841
def to_json(self):
        
        
        data = self.data
        if self.type[-3:] != 'min':
            data = self.data.assign(datetime= self.datetime)
        return QA_util_to_json_from_pandas(data.reset_index())
132692
def to_json(self):
        
        data = dict(self.__dict__)
        data.pop('context',None)
        data['oauth'] = self.oauth.to_dict()
        data['cache'] = self.cache.to_dict()
        return json.dumps(data)
1347029
def to_json(self):
        
        titles = self.get_titles()
        return json.dumps({
                "uri" : self.subject
                , "urn" : str(self.get_urn())
                , "titles" : [{"language":lang, "label":label} for lang, label in titles]
                , "title_abbreviations" : self.get_abbreviations()

            }, indent=2)
530985
def json(self):
        
        data = dict()
        embeds = self.embeds
        self.embeds = list()
        # convert DiscordEmbed to dict
        for embed in embeds:
            self.add_embed(embed)
        for key, value in self.__dict__.items():
            if value and key not in ['url', 'files', 'filename']:
                data[key] = value
        embeds_empty = all(not embed for embed in data["embeds"]) if 'embeds' in data else True
        if embeds_empty and 'content' not in data and bool(self.files) is False:
            logger.error('webhook message is empty! set content or embed data')
        return data
1003085
def serialize(self) -> dict:
        
        data = {**self}
        if "attachments" in self:
            data["attachments"] = json.dumps(self["attachments"])
        return data
305248
def json(
        self,
        *,
        include: 'SetStr' = None,
        exclude: 'SetStr' = None,
        by_alias: bool = False,
        skip_defaults: bool = False,
        encoder: Optional[Callable[[Any], Any]] = None,
        **dumps_kwargs: Any,
    ) -> str:
        
        encoder = cast(Callable[[Any], Any], encoder or self._json_encoder)
        return json.dumps(
            self.dict(include=include, exclude=exclude, by_alias=by_alias, skip_defaults=skip_defaults),
            default=encoder,
            **dumps_kwargs,
        )