import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String s = HttpClient.newHttpClient().send(HttpRequest.newBuilder()
.uri(URI.create(u))
.POST(HttpRequest.BodyPublishers.ofString(content))
.build(), HttpResponse.BodyHandlers.ofString())
.body();
# Create a user agent object
my $ua = LWP::UserAgent->new;
# Create a request
my $req = HTTP::Request->new(POST => $u);
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
print $res->content;
}
else {
print $res->status_line, "\n";
}
perl -Mojo -E 'my $u = "www.example.com"; say p($u)->body;'
[dependencies]
error-chain = "0.12.4"
reqwest = { version = "0.11.2", features = ["blocking"] }
use error_chain::error_chain;
use std::io::Read;
let client = reqwest::blocking::Client::new();
let mut response = client.post(u).body("abc").send()?;
await post(u, body: body, headers: headers);
new HttpClient().PostAsync(u, content);
auto response = post(u, content);
response, err := http.PostForm(u, formValues)
response, err := http.Post(u, contentType, body)
fetch(u, { method: "POST", body: JSON.stringify(data) })
String s = HttpClient.newHttpClient().send(HttpRequest.newBuilder() .uri(URI.create(u)) .POST(HttpRequest.BodyPublishers.ofString(content)) .build(), HttpResponse.BodyHandlers.ofString()) .body();
(dex:post u)
(drakma:http-request u :method :post)
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $u); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); $output = curl_exec($ch); curl_close($ch);
with TFPHTTPClient.Create(nil) do begin Post(u); Free; end;
# Create a user agent object my $ua = LWP::UserAgent->new; # Create a request my $req = HTTP::Request->new(POST => $u); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print $res->status_line, "\n"; }
my $response = `curl -X POST $u`;
perl -Mojo -E 'my $u = "www.example.com"; say p($u)->body;'
data = parse.urlencode(<your data dict>).encode() req = request.Request(u, data=data, method="POST") resp = request.urlopen(req)
Net::HTTP.post(u, content)
let client = reqwest::blocking::Client::new(); let mut response = client.post(u).body("abc").send()?;