Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
11 views2 pages

Crest Sharp

The document contains a C# code snippet using RestSharp to create a REST client that sends a POST request to a specified API endpoint. The request includes a JSON body with details about a medical check-up registration, including employee information and test results. The response from the API is printed to the console.

Uploaded by

helmhiucebok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Crest Sharp

The document contains a C# code snippet using RestSharp to create a REST client that sends a POST request to a specified API endpoint. The request includes a JSON body with details about a medical check-up registration, including employee information and test results. The response from the API is printed to the console.

Uploaded by

helmhiucebok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

===========

C-RestSharp
===========

var options = new RestClientOptions("https://bridging.budisehat-mcu.com")


{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/summary", Method.Post);
request.AddHeader("Content-Type", "application/json");
var body = @"{" + "\n" +
@" ""registerNumber"" : ""25COBA1112A""," + "\n" +
@" ""registerDate"" : ""2025-02-03""," + "\n" +
@" ""npk"" : ""50088""," + "\n" +
@" ""dokter"" : ""---""," + "\n" +
@" ""paketMcu"" : ""General Check Up 1""," + "\n" +
@" ""companyName"" : ""PT. COBA YOGYAKARTA""," + "\n" +
@" ""employee"" : {" + "\n" +
@" ""registerNumber"" : ""COB1150200222""," + "\n" +
@" ""registerDate"" : ""2025-02-03""," + "\n" +
@" ""name"" : ""COBA WASTO""," + "\n" +
@" ""gender"" : ""M""," + "\n" +
@" ""birthday"" : ""1972-01-19""," + "\n" +
@" ""position"" : ""KONDEKTUR UPT SERVICE ON TRAIN SOLOBALAPAN""," + "\
n" +
@" ""unit"" : ""DAOP 6 YOGYAKARTA""" + "\n" +
@" }," + "\n" +
@" ""details"" : [" + "\n" +
@" {" + "\n" +
@" ""parameterId"" : ""00001450""," + "\n" +
@" ""result"" : ""94""," + "\n" +
@" ""flag"" : 0," + "\n" +
@" ""unit"" : """"," + "\n" +
@" ""refValue"" : ""90-100""," + "\n" +
@" ""notes"" : """"," + "\n" +
@" ""seq"" : ""L090300100001""" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""parameterId"" : ""00000062""," + "\n" +
@" ""result"" : ""6.5""," + "\n" +
@" ""flag"" : 0," + "\n" +
@" ""unit"" : """"," + "\n" +
@" ""refValue"" : ""4.0-7.0""," + "\n" +
@" ""notes"" : """"," + "\n" +
@" ""seq"" : ""L090300100005""" + "\n" +
@" }," + "\n" +
@" {" + "\n" +
@" ""parameterId"" : ""00001449""," + "\n" +
@" ""result"" : ""Puasa""," + "\n" +
@" ""flag"" : 0," + "\n" +
@" ""unit"" : """"," + "\n" +
@" ""refValue"" : """"," + "\n" +
@" ""notes"" : """"," + "\n" +
@" ""seq"" : ""C090010010""" + "\n" +
@" }" + "\n" +
@" ]" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);

You might also like