var post = new org.apache.commons.httpclient.methods.PostMethod("https://query.yahooapis.com/v1/public/yql?q="+encodeURIComponent("select item  from weather.forecast where woeid in  (select woeid from geo.places(1)  where text='$location')"));
var client = new org.apache.commons.httpclient.HttpClient();
 
 
post.setRequestHeader("Content-type", "application/json");
post.setRequestHeader("Accept", "application/json");
 
var status = client.executeMethod(post);
var br = new java.io.BufferedReader(new java.io.InputStreamReader(post.getResponseBodyAsStream()));
var response = "";
var line = br.readLine();
while(line != null){
    response = response + line;
    line = br.readLine();
}
 
post.releaseConnection();
 
  
var item = JSON.parse(response);
 
headerMap.put("title" ,item.query.results.channel.item.title);
 
urlParamMap.put("title" ,item.query.results.channel.item.title );
 
bodyText=  'title:'+ item.query.results.channel.item.title;


2:
var url = "http://your-apinizer-ip/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();//onemli silinmemesi gerekli
} catch (err) {
   
}