curl -X POST https://wasapy.com/send-message -H "Content-Type: application/json" -d '{ "api_secret": "your_api_secret", "phone_number": "+1234567890", "message": "Hello, this is a test message" }'
curl -X POST https://your-domain.com/api/send-message \ -d "api_secret=your_api_secret" \ -d "phone_number=+1234567890" \ -d "message=Hello, this is a test message"
$ch = curl_init('https://wasapy.com/send-message'); $data = [ 'api_secret' => 'your_api_secret', 'phone_number' => '+1234567890', 'message' => 'Hello, this is a test message', ]; curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json' ]); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $response = curl_exec($ch); curl_close($ch); echo $response;
$ch = curl_init('https://wasapy.com/send-message'); $data = [ 'api_secret' => 'your_api_secret', 'phone_number' => '+1234567890', 'message' => 'Hello, this is a test message', ]; curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); $response = curl_exec($ch); curl_close($ch); echo $response;
const axios = require('axios'); const data = { api_secret: 'your_api_secret', phone_number: '+1234567890', message: 'Hello, this is a test message' }; axios.post('https://wasapy.com/send-message', data, { headers: { 'Content-Type': 'application/json' } }) .then(response => console.log(response.data)) .catch(error => console.error('Error:', error));
const axios = require('axios'); const qs = require('qs'); const data = { api_secret: 'your_api_secret', phone_number: '+1234567890', message: 'Hello, this is a test message' }; axios.post('https://wasapy.com/send-message', qs.stringify(data)) .then(response => console.log(response.data)) .catch(error => console.error('Error:', error));
import requests url = 'https://wasapy.com/send-message' data = { 'api_secret': 'your_api_secret', 'phone_number': '+1234567890', 'message': 'Hello, this is a test message', } response = requests.post(url, json=data) print(response.text)
import requests url = 'https://wasapy.com/send-message' data = { 'api_secret': 'your_api_secret', 'phone_number': '+1234567890', 'message': 'Hello, this is a test message', } response = requests.post(url, data=data) print(response.text)
import java.net.HttpURLConnection; import java.net.URL; import java.io.OutputStream; public class Main { public static void main(String[] args) { try { URL url = new URL("https://wasapy.com/send-message"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); conn.setDoOutput(true); String jsonInputString = "{\"api_secret\": \"your_api_secret\", \"phone_number\": \"+1234567890\", \"message\": \"Hello, this is a test message\"}"; try (OutputStream os = conn.getOutputStream()) { byte[] input = jsonInputString.getBytes("utf-8"); os.write(input, 0, input.length); } // Handle response here } catch (Exception e) { e.printStackTrace(); } } }
import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; public class Main { public static void main(String[] args) { try { URL url = new URL("https://wasapy.com/send-message"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setDoOutput(true); String formParams = "api_secret=your_api_secret&phone_number=+1234567890&message=Hello, this is a test message"; try (OutputStream os = conn.getOutputStream()) { byte[] input = formParams.getBytes("utf-8"); os.write(input, 0, input.length); } // Handle response here } catch (Exception e) { e.printStackTrace(); } } }