POST Requests
In addition to facilitating GET requests, Site Unblocker also enables you to utilize POST requests to a web endpoint of your preference. This functionality allows you to send data to a specific website, resulting in a modified response from the target.
When sending a body with a POST request, the correct
Content-Type
header should be provided.
curl -X POST -k -v -x unblock.smartproxy.com:60000 'http://httpbin.org/post' \
-U 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json'
-d '{"foo": "bar"}'
import requests
proxies = {
'http': 'http://USERNAME:PASSWORD@unblock.smartproxy.com:60000',
'https': 'http://USERNAME:PASSWORD@unblock.smartproxy.com:60000'
}
data = {
"Your POST data": "data"
}
response = requests.request(
'POST',
'http://httpbin.org/post',
verify=False,
proxies=proxies,
data=data
)
print(response.text)
import fetch from 'node-fetch';
import createHttpsProxyAgent from 'https-proxy-agent'
const username = 'YOUR_USERNAME';
const password = 'YOUR_PASSWORD';
const agent = createHttpsProxyAgent(
`http://${username}:${password}@unblock.smartproxy.com:60000`
);
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;
const headers = {
'Content-Type': 'application/json'
}
const body = {
'Your POST data': 'data'
};
const response = await fetch('http://httpbin.org/post', {
method: 'get',
body: JSON.stringify(body),
headers: headers,
agent: agent
});
console.log(await response.text());
Updated 9 days ago