B4J Question HttpJob error on line 32

the error message:
Waiting for debugger to connect...
Program started.
Error occurred on line: 302 (HttpJob)
java.lang.RuntimeException: Request does not support this method.
at anywheresoftware.b4h.okhttp.OkHttpClientWrapper$OkHttpRequest.SetContentType(OkHttpClientWrapper.java:512)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:673)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:240)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.main(main.java:29)

the code snippet below:
1676352906216.png
 

aeric

Expert
Licensed User
Longtime User
Follow this tutorial.

Post your code in Text.

Instead of using j.GetRequest.initializeGet("http... ")
use:
B4X:
j.Download("http... ")

Put j.GetRequest.SetHeader("... ") after j.Download

Double check the API documentation that the API should be call using POST instead of GET.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top