Android Question CURL GET Call

iruizb

New Member
Licensed User
Hi guys, I'm very Stuck in an App that needs a Curl Call to connect to a service, the Curl Carll I'm Trying to perform is as follows: ( Reference http://docs.weaved.com/docs )

B4X:
curl -s -S -X GET -H "content-type:application/json" -H "apikey:WeavedDemoKey\$2015" https://api.weaved.com/v22/api/user/login/youraccount@email.com/your_weaved_password

I have been looking at all the posts from this topic and I somehow manage to get the translation but is doesn't work, it keeps telling me {"status":"false","reason":"post data missing"} so I guess something is not working in the first set header statement or the arguments are not in the correct position but I have tried any combination an nothing works :(

B4X:
Sub Curl_Click
    
    Dim job1 As HttpJob
    job1.Initialize("MyJob", Me)
    job1.GetRequest.SetHeader("https://api.weaved.com/v22/api/user/login/","<email>/<pass>")
   ' I also tried: job1.GetRequest.SetHeader("https://api.weaved.com/v22/api/user/login/<email>/<pass>","")
    job1.GetRequest.SetHeader("Accept","applicatíon/json")
    job1.GetRequest.SetHeader("apikey","WeavedDemoKey\$2015")
    job1.GetRequest.SetContentEncoding("text/plain")
End Sub

I would really appreciate any help you can give me on this.
Thank you!
 

sorex

Expert
Licensed User
Longtime User
you should set headers after starting your request. I don't see any there?
 
Upvote 0

iruizb

New Member
Licensed User
Hi! Thank you for your Answer, do I need to add something else, all the information on my code is:

B4X:
Dim job1 As HttpJob
    job1.Initialize("MyJob", Me)
    job1.GetRequest.SetHeader(LoginURL , WeavedUser & "/" & WeavedPass)
    job1.GetRequest.SetHeader("Content-Type","*/*")
    job1.GetRequest.SetHeader("Accept","applicatíon/json")
    job1.GetRequest.SetHeader("apikey",WeavedKey)
    job1.GetRequest.SetContentEncoding("gzip, deflate")
    job1.GetRequest.SetContentEncoding("text/plain")
    job1.GetRequest.SetContentType("text/plain")

so I need to change the order of the code? Arent the Headers being set with the Set Headers commands?

Thank you!
 
Upvote 0
Top