File tree 3 files changed +10
-3
lines changed
3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
# purescript-affjax.py
2
2
3
- A port of affjax to purescript-python
3
+ An experimental port of affjax to purescript-python.
Original file line number Diff line number Diff line change 44
44
45
45
# todo - is there an analog for withCredentials here?
46
46
def _ajax (mkHeader , options ):
47
+ print ("called ajax" )
48
+
47
49
def _1 (errback , callback ):
50
+ print ("STARTING" )
48
51
if options ["responseType" ] in ["arraybuffer" , "blob" , "document" ]:
49
52
errback (
50
53
Exception (
@@ -75,6 +78,7 @@ def _toThreading():
75
78
headers = headers ,
76
79
)
77
80
r1 = conn .getresponse ()
81
+ print ("LOOK HERE" )
78
82
callback (
79
83
{
80
84
"status" : r1 .status ,
Original file line number Diff line number Diff line change @@ -7,12 +7,15 @@ import Data.Argonaut.Core as J
7
7
import Data.Either (Either (..))
8
8
import Data.HTTP.Method (Method (..))
9
9
import Effect.Aff (launchAff )
10
+ import Effect.Class (liftEffect )
10
11
import Effect.Class.Console (log )
11
12
12
13
main =
13
14
void $ launchAff
14
15
$ do
15
- result <- AX .request (AX .defaultRequest { url = " /api" , method = Left GET , responseFormat = ResponseFormat .json })
16
+ let
17
+ r = AX .defaultRequest { url = " http://ip.jsontest.com/" , method = Left GET , responseFormat = ResponseFormat .json }
18
+ result <- AX .request r
16
19
case result of
17
- Left err -> log $ " GET /api response failed to decode: " <> AX .printError err
20
+ Left err -> log $ " GET response failed to decode: " <> AX .printError err
18
21
Right response -> log $ " GET /api response: " <> J .stringify response.body
You can’t perform that action at this time.
0 commit comments