- else if args[0] == "POST" then
- var myHttpFetcher = new MyHttpFetcher(curl)
- request.delegate = myHttpFetcher
-
- var postDatas = new HeaderMap
- postDatas["Bugs Bunny"] = "Daffy Duck"
- postDatas["Batman"] = "Robin likes special characters @#ùà!è§'(\"é&://,;<>∞~*"
- postDatas["Batman"] = "Yes you can set multiple identical keys, but APACHE will consider only once, the last one"
- request.datas = postDatas
- request.verbose = false
- var postResponse = request.execute
-
- print "Our body from the callback : {myHttpFetcher.our_body}"
-
- if postResponse isa CurlResponseSuccess then
- print "*** Answer ***"
- print "Status code : {postResponse.status_code}"
- print "Body should be empty, because we decided to manage callbacks : {postResponse.body_str.length}"
- else if postResponse isa CurlResponseFailed then
- print "Error code : {postResponse.error_code}"
- print "Error msg : {postResponse.error_msg}"
- end
+ var my_http_fetcher = new MyHttpFetcher
+ request.delegate = my_http_fetcher
+
+ var post_datas = new HeaderMap
+ post_datas["Bugs Bunny"] = "Daffy Duck"
+ post_datas["Batman"] = "Robin likes special characters @#ùà!è§'(\"é&://,;<>∞~*"
+ post_datas["Batman"] = "Yes you can set multiple identical keys, but APACHE will consider only one, the last one"
+ request.datas = post_datas
+ var response = request.execute
+
+ print "Our body from the callback: {my_http_fetcher.fetched_body}"
+
+ if response isa CurlResponseSuccess then
+ print "*** Answer ***"
+ print "Status code: {response.status_code}"
+ print "Body should be empty, because we decided to manage callbacks: {response.body_str.length}"
+ else if response isa CurlResponseFailed then
+ print "Error code: {response.error_code}"
+ print "Error msg: {response.error_msg}"
+ end