processing-restclient icon indicating copy to clipboard operation
processing-restclient copied to clipboard

version 104: NullPointerException POST

Open lemio opened this issue 7 years ago • 1 comments

Hey,

I'm trying to make an app for android for making a time lapse, I want the images gained by ketai send over http POST to my server. I'm only stuck at the HTTP POST file protocol now, this is where I wanted to use your library. But I'm having some issues...

import com.francisli.processing.restclient.*;

RESTClient client;
HttpRequest request;
void setup() {
  client = new RESTClient(this, "lemio.nl");
  client.logging = true;
  client.setHeader("Host", "lemio.nl");


  //client.POST("lemio.nl/", null, null);
HashMap files = new HashMap();
  files.put("image", "key.png");
  HashMap data = new HashMap();
  data.put("test", "lol");
  client.POST("/mypath",data,files);
}

void responseReceived(HttpRequest request, HttpResponse response) {


  println(response.getContentAsString());
}

void draw() {

}

When I try to compile the last version of this library I get this error:

RESTClient: Connecting to lemio.nl on port 80 RESTClient: An error occurred- java.lang.NullPointerException at com.francisli.processing.restclient.HttpRequest.run(HttpRequest.java:58)

Older versions work for processing for windows, but doesn't seem to work together with the android version of processing it gives this error message:

Duplicate files copied in APK META-INF/LICENSE

lemio avatar Nov 27 '17 00:11 lemio

Hmm... the line number referenced in the error is a logging statement. Do things work if you set client.logging = false?

francisli avatar Dec 07 '17 02:12 francisli