import json,httplib,urllib
connection = httplib.HTTPSConnection('api.parse.com', 443)
params = urllib.urlencode({"username":"cooldude6","password":"p_n7!-e8"})
connection.connect()
connection.request('GET', '/1/login?%s' % params, '', {
"X-Parse-Application-Id": "${APPLICATION_ID}",
"X-Parse-REST-API-Key": "${REST_API_KEY}"
})
result = json.loads(connection.getresponse().read())
print result
skt.Initialize("skt")
skt.Connect("api.parse.com", 443,0)
Program started.
Error occurred on line: 19 (main).
java.lang.NoSuchMethodException: org.apache.http.conn.ssl.SSLSocketFactory.<init>(javax.net.ssl.SSLSocketFactory)
at java.lang.Class.getConstructor0(Class.java:2810)
at java.lang.Class.getConstructor(Class.java:1718)
at anywheresoftware.b4a.http.HttpClientWrapper.InitializeAcceptAll(HttpClientWrapper.java:125)
at b4j.example.httputils2service._initialize(httputils2service.java:78)
at b4j.example.httpjob._initialize(httpjob.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:503)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:215)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:69)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
at b4j.example.main.start(main.java:33)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:216)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
at java.lang.Thread.run(Thread.java:744)
Sub file_Action
Dim j As HttpJob
j.Initialize("file", Me)
j.PostFile("https://api.parse.com/1/files/3000.txt", "D:\parse","3000.txt")
j.GetRequest.SetHeader("X-Parse-REST-API-Key", "opBMoH2Qqguvx3eDhcwEAZ0Jdl4nuLUP5BgRZWZb")
j.GetRequest.SetHeader("X-Parse-Application-Id", "vWcbP5PvajXyGcF123E0Z9F4tSCIwvS9AtIZmwCz")
j.GetRequest.SetContentType("text/plain")
End Sub
Sub save_file(st)
Dim m, m1 As Map
m.Initialize
m1.Initialize
m1.Put("name",filename)
m1.Put("__type","File")
m.Put("html",m1)
Dim gen As JSONGenerator
gen.Initialize(m)
Dim j As HttpJob
j.Initialize("Associate",Me)
j.PostString("https://api.parse.com/1/classes/Family", gen.ToString)
j.GetRequest.SetHeader("X-Parse-REST-API-Key", "opBMoH2Qqguvx3eDhcwEAZ0Jdl4nuLUP5BgRZWZb")
j.GetRequest.SetHeader("X-Parse-Application-Id", "vWcbP5PvajXyGcF123E0Z9F4tSCIwvS9AtIZmwCz")
j.GetRequest.SetContentType("application/json")
End Sub
But it does not find it.connection.request('DELETE', '/1/files/...profile.png', '', {
"X-Parse-Application-Id": "ZGNsrGgSDVZaYmXpnAc5aX4d0Ivc2yASOr8qe1xX",
"X-Parse-Master-Key": "MAIpiN7H5vgnryiSDJ4X9iOQPqKrvUQ2alHCYHAT"
})
Dim ApiKey As String = "opBMoH2Qqguvx3eDhcwEAZ0Jdl4nuLUP5BgRZWZb"
Dim master As String = "BB69dVtdhXyAG9aSPLhIcqkIoOYnrDjQRBiFYMrQ"
Dim AppId As String = "vWcbP5PvajXyGcF123E0Z9F4tSCIwvS9AtIZmwCz"
dim filename as string = "94388913-bf9a-4e70-b0ea-e6768088986f-3000.txt"
Dim j As HttpJob
j.Initialize("del", Me)
' This
j.Delete("https://api.parse.com/1/files/" & filename )
'or this
j.Delete2("https://api.parse.com/1/files",Array As String(filename ))
j.GetRequest.SetHeader("X-Parse-Application-Id", AppId)
j.GetRequest.SetHeader( "X-Parse-Master-Key", master)
'del object
Dim j As HttpJob
j.Initialize("del", Me)
j.Delete("https://api.parse.com/1/classes/Family/9YInGuVMA5")
j.GetRequest.SetHeader("X-Parse-REST-API-Key", ApiKey)
j.GetRequest.SetHeader("X-Parse-Application-Id", AppId)
Note that the name of the file must be the name in the response of the upload operation, rather than the original filename.
...
Dim k As Int = m.Get("No")
m2 = m.Get("html")
If m2.IsInitialized Then
Dim j As HttpJob
j.Initialize("txt"&k,Me) 'k is a way to get the number later in jobDone.
Log("name = " & m2.Get("name")) ' if you want to delete the file you need this name
' Log(m2.get("url")) ' or this ????
j.Download(m2.Get("url")) ' to get the file itself, then save it in the jobDone sub
End If
j.Download2("https://api.parse.com/1/classes/Family", Array As String("where", "{""No"":110}"))
I don't understand.You do not need to escape it.
Array As String("where", "{""No"":110}"))
ErelJust write: "where={""No"":110}"
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?