tencent cloud

Performance Testing Service

Overview
Purchase Guide
Billing Overview
Pay-as-You-Go (postpaid)
Purchasing Channels
Payment Overdue
Refund Instructions
Quick Start
Operation Guide
Performance Testing in Simple Mode
Performance Testing in Script Mode
Performance Testing in JMeter Mode
Project Management
Scenario Management
Traffic Recording
Environment Management
Scheduled Performance Testing
Performance Testing Report
Access Control
Alarm Management
Tag Management
Error Code Manual
Practice Tutorial
Using Prometheus To Monitor Performance Testing Metrics
Using PTS to Playback Requests Recorded by GoReplay
API Documentation
History
Introduction
API Category
Making API Requests
PTS-related APIs
Data Types
Error Codes
JavaScript API List
Overview of JavaScript API List
pts/global
pts/http
pts
pts/dataset
pts/grpc
pts/jsonpath
pts/protobuf
pts/redis
pts/sql
pts/url
pts/util
pts/ws
pts/socketio
pts/socket
FAQs
Related Agreements
Service Level Agreement
Use Limits
Privacy Policy
Data Processing And Security Agreement

Conn.send

PDF
Focus Mode
Font Size
Last updated: 2025-03-10 17:28:37
The send method is used to send request data.
send(b: ArrayBuffer): number

Parameters

Parameter
Type
Description
b
ArrayBuffer
Binary data to be sent.

Return

Type
Description
number
Number of bytes sent.

Samples

Send request data:
import socket from "pts/socket";
import util from 'pts/util';

export default function () {
const tcp_socket = new socket.Conn('tcp', '127.0.0.1', 80);
const data = `GET /get HTTP/1.1
Host: 127.0.0.1
\\n`;
const sent_bytes = tcp_socket.send(util.toArrayBuffer(data));
console.log(sent_bytes); // 35
}


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback