Android - Hacer un POST de un JSONObject

 
Vista:
sin imagen de perfil
Val: 21
Ha disminuido 1 puesto en Android (en relación al último mes)
Gráfica de Android

Hacer un POST de un JSONObject

Publicado por Luis David (11 intervenciones) el 10/01/2019 17:23:16
Tengo un jsonobject con atributos y tengo un jsonserver local, de que manera puedo realizar un post para guardar ese objeto en el servidor.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
try {
    jsonObject.put("author",noticia.getAuthor());
    jsonObject.put("title",noticia.getTitle());
    jsonObject.put("description", noticia.getDescription());
    jsonObject.put("url", noticia.getUrl());
    jsonObject.put("urlToImage",noticia.getUrlToImage());
    jsonObject.put("publishedAt",noticia.getFormatPublishedAt());
 
}catch (JSONException e){
    e.printStackTrace();
}
final String result = jsonObject.toString();
 
System.out.println(result);
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder