// SendText sends a text response with status code.
177547
func (s *Socket) SendText(data string) (err error) {
	return s.Conn.WriteMessage(websocket.TextMessage, []byte(data))
}
436472
func (a *DispatchKeyEventArgs) SetText(text string) *DispatchKeyEventArgs {
	a.Text = &text
	return a
}
1369792
func (c *TableCell) SetText(text string) *TableCell {
	c.Text = text
	return c
}
184378
func (c *Context) SendAction(s string) error {
	_, err := c.Bot().API.Send(tg.NewChatAction(c.Chat.ID, s))
	return err
}
164439
func (c *Websocket) WriteText(s string) *Websocket {
	if c.checkUnusable("WriteText") {
		return c
	}
	return c.WriteMessage(websocket.TextMessage, []byte(s))
}
358277
func sendChat(parameters Chat) {
    jsonParameters, err := json.Marshal(parameters)
    check_error(err)

    response, err := http.Post(FlowdockChatUrl + FlowdockFlowToken, "application/json", bytes.NewReader(jsonParameters))

    if response.StatusCode == 200 {
        fmt.Print("-> Chat message correctly sent.\n")
    } else {
        body, _ := ioutil.ReadAll(response.Body)
        fmt.Errorf("-> Error while sending chat message: %s %s\n", response.Status, string(body))
    }
}
221906
func (c *SMS) Send(msg *SMSMessage) (*MessageResponse, error) {
	if len(msg.From) <= 0 {
		return nil, errors.New("Invalid From field specified")
	}

	if len(msg.To) <= 0 {
		return nil, errors.New("Invalid To field specified")
	}

	if len(msg.ClientReference) > 40 {
		return nil, errors.New("Client reference too long")
	}

	var messageResponse *MessageResponse

	switch msg.Type {
	case Text:
	case Unicode:
		if len(msg.Text) <= 0 {
			return nil, errors.New("Invalid message text")
		}
	case Binary:
		if len(msg.UDH) == 0 || len(msg.Body) == 0 {
			return nil, errors.New("Invalid binary message")
		}

	case WAPPush:
		if len(msg.URL) == 0 || len(msg.Title) == 0 {
			return nil, errors.New("Invalid WAP Push parameters")
		}
	}
	if !c.client.useOauth {
		msg.apiKey = c.client.apiKey
		msg.apiSecret = c.client.apiSecret
	}

	var r *http.Request
	buf, err := json.Marshal(msg)
	if err != nil {
		return nil, errors.New("invalid message struct - unable to convert to JSON")
	}
	b := bytes.NewBuffer(buf)
	r, _ = http.NewRequest("POST", apiRoot+"/sms/json", b)

	r.Header.Add("Accept", "application/json")
	r.Header.Add("Content-Type", "application/json")

	resp, err := c.client.HTTPClient.Do(r)

	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)

	err = json.Unmarshal(body, &messageResponse)
	if err != nil {
		return nil, err
	}
	return messageResponse, nil
}
1107192
func (s *DetectSyntaxInput) SetText(v string) *DetectSyntaxInput {
	s.Text = &v
	return s
}
1030195
func SendResponse(w io.Writer, data []byte) (int, error) {
	err := binary.Write(w, binary.BigEndian, int32(len(data)))
	if err != nil {
		return 0, err
	}

	n, err := w.Write(data)
	if err != nil {
		return 0, err
	}

	return (n + 4), nil
}
695871
func (this *Weixinmp) ReplyTextMsg(rw http.ResponseWriter, content string) error {
	var msg textMsg
	msg.MsgType = "text"
	msg.Content = content
	return this.replyMsg(rw, &msg)
}
995605
func (c *chatLocal) SendTextMessage(
	ctx context.Context, tlfName tlf.CanonicalName, tlfType tlf.Type,
	convID chat1.ConversationID, body string) error {
	c.data.lock.Lock()
	defer c.data.lock.Unlock()
	conv, ok := c.data.convs[tlfType][tlfName][convID.String()]
	if !ok {
		return errors.Errorf("Conversation %s doesn't exist", convID.String())
	}
	conv.messages = append(conv.messages, body)
	conv.mtime = c.config.Clock().Now()

	c.lock.Lock()
	// For testing purposes just keep a running tab of all
	// self-written conversations.  Reconsider if we run into memory
	// or performance issues.  TODO: if we ever run an edit history
	// test with multiple devices from the same user, we'll need to
	// save this data in the shared info.
	c.selfConvInfos = append(
		c.selfConvInfos, selfConvInfo{convID, tlfName, tlfType})
	c.lock.Unlock()

	// TODO: if there are some users who can read this folder but who
	// haven't yet subscribed to the conversation, we should send them
	// a new channel notification.
	for _, cb := range conv.cbs {
		cb(convID, body)
	}

	return nil
}
1268158
func SendResponse(req Request, response Response) error {
	return SendResponseWithClient(http.DefaultClient, req, response)
}
1047706
func (s *DetectEntitiesInput) SetText(v string) *DetectEntitiesInput {
	s.Text = &v
	return s
}
686855
func (msgCtx *messageContext) sendResponse(packet *PacketResponse) {
	select {
	case msgCtx.responses <- packet:
		// Successfully sent packet to message handler.
	case <-msgCtx.done:
		// The request handler is done and will not receive more
		// packets.
	}
}
225605
func (s *NoteUpdate) SetText(v string) *NoteUpdate {
	s.Text = &v
	return s
}
243892
func (t *TextView) SetText(text string) *TextView {
	t.Clear()
	fmt.Fprint(t, text)
	return t
}
35621
func (f *Field) SetText(text string) FieldInterface {
	if f.fieldType == formcommon.BUTTON ||
		f.fieldType == formcommon.SUBMIT ||
		f.fieldType == formcommon.RESET ||
		f.fieldType == formcommon.STATIC ||
		f.fieldType == formcommon.TEXTAREA {
		f.additionalData["text"] = text
	}
	return f
}