Post a JSON-encoded message to channel.
512765
def publish_json(self, channel, obj):
        """"""
        return self.publish(channel, json.dumps(obj))
1153808
def send_message(self, msg, stats=True):
        
        self.send_jsonified(proto.json_encode(msg), stats)
542415
def _reply_json(self, json_payload, status_code=200):
        
        self._send_headers(status_code=status_code)
        json_str = json.dumps(json_payload)
        self.wfile.write(json_str)
417900
def json_post(methodname, rtype, key):
    """"""
    return compose(
        reusable,
        map_return(registry(rtype), itemgetter(key)),
        basic_interaction,
        map_yield(partial(_json_as_post, methodname)),
        oneyield,
    )
940124
def send(self, topic, message):
        """"""

        if not message:
            Log.error("Expecting a message")

        message._prepare()

        if not self.connection:
            self.connect()

        producer = Producer(
            channel=self.connection,
            exchange=Exchange(self.settings.exchange, type='topic'),
            routing_key=topic
        )

        # The message is actually a simple envelope format with a payload and
        # some metadata.
        final_data = Data(
            payload=message.data,
            _meta=set_default({
                'exchange': self.settings.exchange,
                'routing_key': message.routing_key,
                'serializer': self.settings.serializer,
                'sent': time_to_string(datetime.datetime.now(timezone(self.settings.broker_timezone))),
                'count': self.count
            }, message.metadata)
        )

        producer.publish(jsons.scrub(final_data), serializer=self.settings.serializer)
        self.count += 1
793134
def send_tip(self, sender, receiver, message, context_uid, meta):
        
        assert self.channel is not None, "channel must be defined"

        # Add extra data to meta
        meta["mention_bot"] = self.mention_bot()

        data = json.dumps({
            "channel": self.channel,
            "sender": sender,
            "receiver": receiver,
            "message": message,
            "context_uid": context_uid,
            "meta": meta,
        })
        response = requests.post(self.get_api_url("/tips/"), data=data, headers={'content-type': 'application/json'})
        if response.headers.get("Content-Type", None) == "application/json":
            out = response.json()
            out["state"] = response.reason.lower()
            return out
        else:
            return {"state": response.reason.lower(), "error": "%s error submitting tip" % response.status_code}
1085451
def _write_json(self, message, extra):
        '''
        
        '''
        self.logger.info(message, extra=extra)
682887
public static void postJsonMessage(StringEntity input) {
		String pageToken = FbBotMillContext.getInstance().getPageToken();
		// If the page token is invalid, returns.
		if (!validatePageToken(pageToken)) {
			return;
		}

		String url = FbBotMillNetworkConstants.FACEBOOK_BASE_URL
				+ FbBotMillNetworkConstants.FACEBOOK_MESSAGES_URL + pageToken;
		postInternal(url, input);
	}
159591
def push_msg(self, channel_id, msg):
        

        if type(msg) is not str:
            msg = urlencode(msg)

        return self.push(channel_id, msg)
912405
def post(ctx, odm):
    """"""
    try:
        ctx.obj['RWS'].send_request(PostDataRequest(odm.read()))
        if ctx.obj['RAW']:
            click.echo(ctx.obj['RWS'].last_result.text)
    except RWSException as e:
        click.echo(e.message)
542086
def chat_post_message(self, channel, text, **params):
        
        method = 'chat.postMessage'
        params.update({
            'channel': channel,
            'text': text,
        })
        return self._make_request(method, params)
225005
def post_json(self, url, data, cls=None, **kwargs):
        
        kwargs['data'] = to_json(data, cls=cls)
        kwargs['headers'] = self.default_headers
        return self.post(url, **kwargs).json()
1334153
def publish(self, message, key=None, **kws):
        """"""
        return PSPut(self, message, key, **kws)
814005
def publish(self, channel, message):
        
        if self.cfg.jsonpickle:
            message = jsonpickle.encode(message)
        return self.conn.publish(channel, message)
36192
def dispatch(message, channel)
      push(Oj.dump(message, mode: :compat)) unless channel =~ /\Aslanger:/

      perform_client_webhook!(message)
    end
533063
def post(self, url, data=None, json=None, callback=None, retry=0, **kwargs):
        """"""
        return self.request(
            "post",
            url=url,
            data=data,
            json=json,
            callback=callback,
            retry=retry,
            **kwargs
        )
805012
def push_object(self, channel_id, obj):
        

        return self.push(channel_id, json.dumps(obj).replace('"', '\\"'))