I have a series of 4 request on postman that are working but I can't seem to figure out how to make them work in b4x.
I tried this but I get a negative response from server.
These are other requests :
Java:
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://xx.xx.xx")
.method("POST", body)
.addHeader("Key", "123456789")
.addHeader("Authorization", "Basic ")
.build();
Response response = client.newCall(request).execute();
I tried this but I get a negative response from server.
B4X:
Dim j As HttpJob
j.Initialize("",Me)
j.Download("https://xx.xx.xx")
j.GetRequest.SetHeader("Key", "123456789")
j.GetRequest.SetHeader("Authorization", "Basic ")
wait for (j) JobDone(job As HttpJob)
If job.Success Then
Log(job.GetString)
Else
Log(job.ErrorMessage)
End If
These are other requests :
Java:
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://xxx.xxx.xxx")
.method("POST", body)
.addHeader("env", "")
.addHeader("Key", "123456")
.addHeader("Authorization", "Bearer ")
.addHeader("Id", "")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Java:
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://xxx.xxx.xxx")
.method("GET", null)
.addHeader("env", "")
.addHeader("Key", "123456789")
.addHeader("Authorization", "Bearer ")
.build();
Response response = client.newCall(request).execute();