Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package chat.parse; import java.io.IOException; import org.apache.http.HttpEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.json.JSONException; import org.json.JSONObject; /** * * @author user */ public class ChatParse { /** * @param args the command line arguments */ public static void main(String[] args) throws JSONException, IOException { String url = "https://api.parse.com/1/classes/"; String applicationkey = "RfIUZYQki1tKxFhciTxjD4a712gy1SeY9sw7hhbO"; String RestApiKey = "WjlZA2VIuonVgd6FKac6tpO8LGztARUHUKFEmeTi"; CloseableHttpClient client = HttpClients.createDefault(); HttpPost post = new HttpPost(url + "contatti"); post.addHeader("Content-Type", "application/json"); post.addHeader("X-Parse-Application-Id", applicationkey); post.addHeader("X-Parse-REST-API-Key", RestApiKey); JSONObject obj = new JSONObject(); obj.put("nome", "Paolo"); obj.put("surname", "Possanzini"); obj.put("email", "paolo@teamdev.it"); post.setEntity(new StringEntity(obj.toString())); client.execute(post); } }