B4J Question Support for DELETE and PUT verbs in jServer

Bruce Axtens

Active Member
Licensed User
Longtime User
What must be done to permit jServer to handle DELETE and PUT verbs? I was rather hoping that B4J might be useful for a REST server.
 

jmon

Well-Known Member
Licensed User
Longtime User
You can PUT and DELETE using HttpJob:

Example:
B4X:
Dim job As HttpJob
job.Initialize("CalendarDelete", Me)
job.Delete("https://www.googleapis.com/calendar/v3/calendars/" & su.EncodeUrl(CalendarId, "UTF8") _
    & "?access_token=" & oAuthAccessToken)

Dim m As Map = CreateMap("id":CalendarId, "summary":Summary, "description":Description)   
Dim job As HttpJob
job.Initialize("CalendarUpdate", Me)
job.PutString("https://www.googleapis.com/calendar/v3/calendars/" & su.EncodeUrl(CalendarId, "UTF8") _
    & "?access_token=" & oAuthAccessToken, Parse2(m))
job.GetRequest.SetContentType("application/json")
 
Upvote 0

Bruce Axtens

Active Member
Licensed User
Longtime User
Sorry, it's been a while since I last did some B4J: I'm wanting to create a tool to handle incoming GET, POST, PUT and DELETE requests. Those, good as they are, seem to be related to outgoing traffic.
 
Upvote 0

Bruce Axtens

Active Member
Licensed User
Longtime User
Upvote 0
Top