Serializable::inspect
to show more useful information
curl :: native_curl
Binding of C libCurl which allow us to interact with network.serialization :: serialization_core
Abstract services to serialize Nit objects to different formatsdeserialize_json
and JsonDeserializer
serialize_to_json
and JsonSerializer
core :: union_find
union–find algorithm using an efficient disjoint-set data structure
import curl
import json
class Person
serialize
var name : String
var age : Int
end
var url = "http://example.com"
# POST REQUEST
var my_request = new CurlHTTPRequest(url, method="POST")
var person = new Person("Jean",12)
my_request.body = person.serialize_to_json
my_request.execute
# # USE WITH SOCKET ADDRESS FAMILY
# var my_unix_request = new CurlHTTPRequest("http:///tmp/", method="POST")
# my_unix_request.body = person.serialize_to_json
# my_unix_request.unix_socket_path = "/tmp/test.sock"
# my_unix_request.execute
lib/curl/examples/curl_rest.nit:20,1--37,18