Documentation Index
Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
Use this file to discover all available pages before exploring further.
You can send HTTP requests to endpoints defined in Apinizer using JavaScript. This page contains an example of sending data with PUT method to an endpoint within Apinizer.
Documentation Index
Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
Use this file to discover all available pages before exploring further.
var url = "http://10.1.1.1:30080/apigateway/apinizerlog/InsertLog";
var tarih = new Date().toISOString();
var servisAdi = 'Servis Adı Yazılacak';
var uygulama = 'Uygulama Adı Yazılacak';
var ip = headerMap.get('X-Forwarded-For');
var kullaniciAdi = headerMap.get('username');
var parametre = JSON.stringify(bodyText);
var data = JSON.stringify({
"Tarih": tarih,
"ServisAdi": servisAdi,
"IP": ip,
"KullaniciAdi": kullaniciAdi,
"Parametre": parametre,
"Uygulama": uygulama
});
try {
var con = new java.net.URL(url).openConnection();
con.setConnectTimeout(15000);
con.setReadTimeout(15000);
con.setRequestMethod("PUT");
con.setUseCaches(false);
con.setDoInput(true);
con.setDoOutput(true);
con.setRequestProperty("Content-Length", data.length);
var wr = new java.io.DataOutputStream(con.getOutputStream());
wr.writeBytes(data);
wr.flush();
wr.close();
con.getResponseCode(); // önemli silinmemesi gerekli
} catch (err) {
}
con.getResponseCode() call is necessary for the connection to complete and should not be deleted.Was this page helpful?