[JAVA] POST Is the code you are requesting correct?

import http.requests.*;

public void setup(){

PostRequest post = new PostRequest(“http://cloud.efento.io”);
post.addHeader(“Content-Type”, “application/json”);
post.addData(“charset”, “UTF-8”);
post.addData(“X-Api-Token:”,“sdffsWED34sdfFG6wddV3”);
post.send(); //send request
println(post.getContent()); //print response

noLoop();

}

public void draw(){

}

This is the information within the EFENTO GATEWAY API V2 documentation.

I want to collect data through the API. Is it correct to receive data as above?

If you know, let me know. Please.

you need to format the code with </> not as quotation. Also I recommend to delete the api key in the code :slight_smile:

2 Likes

Dear micuat / @micuat

Is the post code correct?
Is it right to use it like that?

And I don’t know how to make a post form.

And I got the sdk file, but I don’t know how to use it.

no that’s not how you format the code. there is </> button that creates

```
```

in the editor and you post the code in between.

Could you tell us a bit more what you are trying to do? You are using POST request, so do you want to upload data? Or are you retrieving data from the cloud server? Also please don’t make another thread if you want to ask a highly relevant question :slight_smile: