Guys,
need help and advice please,
we have to parsing some json data to internet with DELETE method but we meet no solution with B4A.
we try parsing through www.hurl.it in chrome to make sure that all parameter and json data included when we submit. Then it is success.
this is the data and delete method : (see hurl2.png)
and the result success : (see hurl.png)
we already use GetRequest.InitializeDelete as Method Delete like in this thread
and also follow this thread
But both of thread can bring any solution for us..
bellow is our code :
and result when job.success is false and message is :
Unsupported Media Type
is there something that we missing?
thank you.
need help and advice please,
we have to parsing some json data to internet with DELETE method but we meet no solution with B4A.
we try parsing through www.hurl.it in chrome to make sure that all parameter and json data included when we submit. Then it is success.
this is the data and delete method : (see hurl2.png)
and the result success : (see hurl.png)
we already use GetRequest.InitializeDelete as Method Delete like in this thread
and also follow this thread
But both of thread can bring any solution for us..
bellow is our code :
Public Sub CancelOrder(optype As String, token As String, therapistId As String, deviceId As String, username As String, orderId As String, reasonId As String, reasonText As String)
ProgressDialogShow("... mohon sabar... ")
opProses = optype
dim wsxHttpJob as httpjob
wsxHttpJob.initialized("job",me)
Dim mCncl As Map
mCncl.Initialize
mCncl.Put("reasonId",reasonId)
mCncl.Put("reasonText",reasonText)
mCncl.Put("username", username)
mCncl.Put("deviceId", deviceId)
Dim jg1 As JSONGenerator
jg1.Initialize(mCncl)
wsxHttpJob.PostString("http://my-url.com?token="&token,jg1.ToPrettyString(4))
wsxHttpJob.GetRequest.SetHeader("Content-Type","application/json;charset=UTF-8")
wsxHttpJob.GetRequest.SetHeader("Accept", "*/*")
wsxHttpJob.GetRequest.InitializeDelete(urlLocation & urlReschedule & orderId& "?access_token="&token)
wsxHttpJob.Username = AuthUsername
wsxHttpJob.Password = AuthPassword
End Sub
ProgressDialogShow("... mohon sabar... ")
opProses = optype
dim wsxHttpJob as httpjob
wsxHttpJob.initialized("job",me)
Dim mCncl As Map
mCncl.Initialize
mCncl.Put("reasonId",reasonId)
mCncl.Put("reasonText",reasonText)
mCncl.Put("username", username)
mCncl.Put("deviceId", deviceId)
Dim jg1 As JSONGenerator
jg1.Initialize(mCncl)
wsxHttpJob.PostString("http://my-url.com?token="&token,jg1.ToPrettyString(4))
wsxHttpJob.GetRequest.SetHeader("Content-Type","application/json;charset=UTF-8")
wsxHttpJob.GetRequest.SetHeader("Accept", "*/*")
wsxHttpJob.GetRequest.InitializeDelete(urlLocation & urlReschedule & orderId& "?access_token="&token)
wsxHttpJob.Username = AuthUsername
wsxHttpJob.Password = AuthPassword
End Sub
Unsupported Media Type
is there something that we missing?
thank you.
Attachments
Last edited: