Example usage for com.squareup.okhttp FormEncodingBuilder FormEncodingBuilder

List of usage examples for com.squareup.okhttp FormEncodingBuilder FormEncodingBuilder

Introduction

In this page you can find the example usage for com.squareup.okhttp FormEncodingBuilder FormEncodingBuilder.

Prototype

FormEncodingBuilder

Source Link

Usage

From source file:Logica.Flask.java

public static String sendText(String usuario, String empresa, String departamento, String id, String tipo) {

    RequestBody formBody = new FormEncodingBuilder().add("tipo", tipo).add("usuario", usuario)
            .add("empresa", empresa).add("departamento", departamento).add("id", id).build();
    String r = getString("Matriz", formBody);
    return r;/*w  w w.  j  av  a 2  s.c om*/
}

From source file:Logica.Flask.java

public static String sendText(String usuario, String empresa, String departamento, String nombre,
        String descripcion, String tipo) {

    RequestBody formBody = new FormEncodingBuilder().add("tipo", tipo).add("usuario", usuario)
            .add("empresa", empresa).add("departamento", departamento).add("nombre", nombre)
            .add("descripcion", descripcion).build();
    String r = getString("Matriz", formBody);
    return r;/*from  w  ww . jav  a  2s.  c  o m*/
}

From source file:menu.cola.java

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    String val = jTextField1.getText().toString();
    RequestBody formBody = new FormEncodingBuilder().add("valor", val).build();
    String q = getString("AddCola", formBody);
    System.out.println(q + "#");

    // TODO add your handling code here:
}

From source file:menu.cola.java

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    String val = jTextField1.getText().toString();
    RequestBody formBody2 = new FormEncodingBuilder().add("valor", val).build();
    String w = getString2("PopCola", formBody2);
    System.out.println(w + "#");
    // TODO add your handling code here:
}

From source file:menu.lista.java

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    String val = jTextField1.getText().toString();
    RequestBody formBody2 = new FormEncodingBuilder().add("valor", val).build();
    String w = getString1("AddLista", formBody2);
    System.out.println(w + "#");
    // TODO add your handling code here:
}

From source file:menu.lista.java

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    String val = jTextField2.getText().toString();
    RequestBody formBody2 = new FormEncodingBuilder().add("valor", val).build();
    String w = getString2("popLista", formBody2);
    System.out.println(w + "#");
    // TODO add your handling code here:
}

From source file:menu.lista.java

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
    String val = jTextField3.getText().toString();
    RequestBody formBody2 = new FormEncodingBuilder().add("valor", val).build();
    String w = getString3("searchLista", formBody2);
    System.out.println(w + "#");
    // TODO add your handling code here:
}

From source file:menu.pila.java

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    String val = jTextField1.getText().toString();
    RequestBody formBody = new FormEncodingBuilder().add("valor", val).build();
    String q = getString("AddPila", formBody);
    System.out.println(q + "#");

    // TODO add your handling code here:
}

From source file:menu.pila.java

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    String val = jTextField1.getText().toString();
    RequestBody formBody2 = new FormEncodingBuilder().add("valor", val).build();
    String w = getString2("PopPila", formBody2);
    System.out.println(w + "#");
    // TODO add your handling code here:
}

From source file:net.codestory.rest.misc.PostBody.java

License:Apache License

public static RequestBody form(String firstParameterName, Object firstParameterValue,
        Object... parameterNameValuePairs) {
    FormEncodingBuilder form = new FormEncodingBuilder();

    form.add(firstParameterName, firstParameterValue.toString());
    for (int i = 0; i < parameterNameValuePairs.length; i += 2) {
        form.add(parameterNameValuePairs[i].toString(), parameterNameValuePairs[i + 1].toString());
    }/*from  w  w w  .j  a  v a 2 s  .  c om*/

    return form.build();
}