;\",priv_passphrase=\"N;9()3W'v\",priv_protocol=\"DES\",security_engine_id=\"7FfD763D\",security_name=\"david\",server=\"qd9f.example.com\",trap_oid=\"2.2,,\"}\n\n-- Sample result:\n-- (no output)\n"},"swift-nsurlsession":{"filename":"set-using-swift-nsurlsession.swift","data":"// \r// Sample for event notification server object / sinks[] / data.\r// \r// This is a sample demonstrating how to set the data.\r// \r\r// Note that this sample has been generated by httpsnippet;\r// authentication configuration (usually digest) is not included.\r\rimport Foundation\r\rlet headers = [\r \"Connection\": \"close\",\r \"Content-Type\": \"application/json\",\r \"X-CSRF\": \"x\"\r]\rlet parameters = [\r \"security_engine_id\": \"\",\r \"context_engine_id\": \"\",\r \"auth_protocol\": \"\",\r \"priv_protocol\": \"AES\",\r \"priv_passphrase\": \"bx&{.*&B(cR\",\r \"auth_passphrase\": \"UZjEfaH0G\",\r \"context_name\": \"1S|R\",\r \"security_name\": \"kenneth\",\r \"trap_oid\": \"0.195,,,\",\r \"server\": \"sb65j.kaa0d8.example.com\"\r] as [String : Any]\r\rlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\r\rlet request = NSMutableURLRequest(url: NSURL(string: \"http://192.168.0.100/restapi/notification/sinks/:sink_index/data/\")! as URL,\r cachePolicy: .useProtocolCachePolicy,\r timeoutInterval: 10.0)\rrequest.httpMethod = \"PUT\"\rrequest.allHTTPHeaderFields = headers\rrequest.httpBody = postData as Data\r\rlet session = URLSession.shared\rlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\r if (error != nil) {\r print(error)\r } else {\r let httpResponse = response as? HTTPURLResponse\r print(httpResponse)\r }\r})\r\rdataTask.resume()\r\r\r// Sample result:\r// \r"}},"get":{"shell-httpie":{"filename":"get-using-shell-httpie.sh","data":"#!/bin/sh\n# \n# Sample for event notification server object / sinks[] / data.\n# \n# This is a sample demonstrating how to get the data.\n# \n\n# Note that this sample has been generated by httpsnippet;\n# authentication configuration (usually digest) is not included.\n\nhttp GET http://192.168.0.100/restapi/notification/sinks/:sink_index/data/ \\\n Accept:application/json \\\n Connection:close\n\n\n# Sample result:\n# {\"password\":\"/7#setRequestUrl('http://192.168.0.100/restapi/notification/sinks/:sink_index/data/');\n$request->setRequestMethod('GET');\n$request->setHeaders([\n 'Connection' => 'close',\n 'Accept' => 'application/json'\n]);\n\n$client->enqueue($request)->send();\n$response = $client->getResponse();\n\necho $response->getBody();\n\n\n// Sample result:\n// {\"password\":\"/7#\r\rNSDictionary *headers = @{ @\"Connection\": @\"close\",\r @\"Accept\": @\"application/json\" };\r\rNSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"http://192.168.0.100/restapi/notification/sinks/:sink_index/data/\"]\r cachePolicy:NSURLRequestUseProtocolCachePolicy\r timeoutInterval:10.0];\r[request setHTTPMethod:@\"GET\"];\r[request setAllHTTPHeaderFields:headers];\r\rNSURLSession *session = [NSURLSession sharedSession];\rNSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request\r completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\r if (error) {\r NSLog(@\"%@\", error);\r } else {\r NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;\r NSLog(@\"%@\", httpResponse);\r }\r }];\r[dataTask resume];\r\r\r// Sample result:\r// {\"password\":\"/7# \"http://192.168.0.100/restapi/notification/sinks/:sink_index/data/\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n \"Accept: application/json\",\n \"Connection: close\"\n ],\n]);\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}\n\n\n// Sample result:\n// {\"password\":\"/7#>= fun (res, body_stream) ->\n (* Do stuff with the result *)\n\n\n(* Sample result:*)\n(* {\"password\":\"/7#setUrl('http://192.168.0.100/restapi/notification/sinks/:sink_index/data/');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders([\n 'Connection' => 'close',\n 'Accept' => 'application/json'\n]);\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}\n\n\n// Sample result:\n// {\"password\":\"/7# response = Unirest.get(\"http://192.168.0.100/restapi/notification/sinks/:sink_index/data/\")\n .header(\"Connection\", \"close\")\n .header(\"Accept\", \"application/json\")\n .asString();\n\n\n// Sample result:\n// {\"password\":\"/7# {\n console.log(response);\n})\n.catch(err => {\n console.error(err);\n});\n\n\n// Sample result:\n// {\"password\":\"/7# response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(response.body());\n\n\n// Sample result:\n// {\"password\":\"/7# Void in\r if (error != nil) {\r print(error)\r } else {\r let httpResponse = response as? HTTPURLResponse\r print(httpResponse)\r }\r})\r\rdataTask.resume()\r\r\r// Sample result:\r// {\"password\":\"/7#