# Base64 encode
curl -X POST https://tcpdata.com/encode \
-H "Content-Type: application/json" \
-d '{"text":"Hello World!","format":"base64"}'
# Returns: {"encoded":"SGVsbG8gV29ybGQh"}
# URL encode
curl -X POST https://tcpdata.com/encode \
-H "Content-Type: application/json" \
-d '{"text":"hello world!","format":"url"}'
# Hex encode
curl -X POST https://tcpdata.com/encode \
-H "Content-Type: application/json" \
-d '{"text":"ABC","format":"hex"}'
const response = await fetch('https://tcpdata.com/encode', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
text: 'Hello World!',
format: 'base64'
})
});
const result = await response.json();
console.log(result.encoded);
import requests
response = requests.post('https://tcpdata.com/encode', json={
'text': 'Hello World!',
'format': 'base64'
})
print(response.json()['encoded'])