I send a Request to an API and if there are no Alerts i will receive this Answer:
B4X:
HTTP/1.1 204 User found but no alerts were found.
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type, Authorization, Accept, Date
Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Connection: close
Content-Length: 0
My problem is now that i get no answer from httputils2 like job done event.
I would use first the HTTP Lib for this task (http://www.b4x.com/android/help/http.html). Init with the Url of your request and then use StatusCode As Int [read only]. When the Code is 204 there will be no content, which means that you will have an empty result in your httputils2 request.
You can use HttpUtils2 source code instead of the library and modify HttpUtils2Service:
B4X:
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
If Response.ContentLength = 0 Then
CompleteJob(TaskId, True, "")
Else
Response.GetAsynchronously("response", File.OpenOutput(TempFolder, TaskId, False), _
True, TaskId)
End If
End Sub