Android Question CURL syntax with Basic Auth

Discussion in 'Android Questions' started by Daniel-White, Jul 2, 2015.

  1. Daniel-White

    Daniel-White Active Member Licensed User

    Hi guys, I am exploring how will be the syntax of this curl to something like httputils2 ,httpjob or similar B4A.

    curl -X DELETE --user username : password

    I have problem about how tell to the web using B4A , the "DELETE" and how give to the website the username and password.

    the is a json

    the auth is basic that mean base 64 encode.

    Thanks you Indeed.
    Daniel W
    Last edited: Jul 2, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    Use HttpUtils2 source code instead of the library and add this sub to HttpJob:
    Public Sub Delete(Link As String)
    "SubmitJob", Me)
    End Sub
  3. Daniel-White

    Daniel-White Active Member Licensed User

    Thanks you Indeed Erel, one question for everybody here, when use the credentials in httputils2 "To send credentials you should set Job.UserName and Job.Password fields before sending the request." I read from it will need to encode with base64? or it is done?, I use my sniffer when run curl, and see the credentials example username : password like this example daniel:123 in plain text and the encoding in 64 is like this ZGFuaWVsOjEyMw==

    I am trying to do the same with B4A , I did with curl, the web is wordexpress. and I am little bit confuse with username : password and base64, it will be a header? how format that in B4A. I read a similar code here, but I did not see the base 64 for basic auth.
  4. Erel

    Erel Administrator Staff Member Licensed User

    Basic authentication doesn't require the password to be base 64 encoded. You can use StringUtils to encode it.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice