Edit: You mean the code inside Sub Process_Globals as changed in Version: 4.30
B4X:
Public Const RESPONSE_ELEMENT_MESSAGE As String = "m"
Public Const RESPONSE_ELEMENT_CODE As String = "a"
Public Const RESPONSE_ELEMENT_STATUS As String = "s"
Public Const RESPONSE_ELEMENT_TYPE As String = "t"
Public Const RESPONSE_ELEMENT_ERROR As String = "e"
Public Const RESPONSE_ELEMENT_RESULT As String = "r"
Do you mean to read the
1. JSON payload sent from the client to ther server using OkHttpUtils2 in Post/Put body
or
2. JSON responses that will send back to the client as output?
Edit: So now I think you are referring to the JSON response.
Can you post some code of what you are trying to achieve?
In your earlier dialog, you showed 2 json results side by side. One using the default keys and the other using more descriptive keys. the suggestion was that by changing the globals in the WebApiUtils.bas file, you can make the keys more descriptive (https://www.b4x.com/android/forum/threads/web-webapiutils-v5-50.167012/#post-1024681).
My question is how do i update the WebApiUtils.bas source file to add the updated constants?
Take the example of the screenshot for the following endpoint in FindApiHandler:
http://127.0.0.1:8080/api/find/products-by-category_id/2
You just need to add the following code:
For Pakai v4:
B4X:
Public Sub Initialize
HRM.Initialize
HRM.VerboseMode = Main.conf.VerboseMode
HRM.ResponseKeys = Array("m", "a", "r")
HRM.ResponseKeysAlias = Array("message", "code", "data")
End Sub
For Pakai v5:
B4X:
Public Sub Initialize
App = Main.App
HRM.Initialize
Main.SetApiMessage(HRM)
DB.Initialize(Main.DBType, Null)
HRM.ResponseKeys = Array("m", "a", "r")
HRM.ResponseKeysAlias = Array("message", "code", "data")
End Sub