curl4delphi
curl4delphi copied to clipboard
Add a json post request example
curl := CurlGet;
curl.SetUrl('https://empacser.now.sh/api/sync_proxy')
.SetCustomHeaders(
CurlGetSlist
.AddRaw('Content-type: application/json')
.AddRaw('Accept: */*')
)
.SetProxyFromIe
.SetOpt(CURLOPT_POST, true)
.SetOpt(CURLOPT_POSTFIELDS, TEncoding.UTF8.GetBytes('{"xyz": 10}'))
.SetCaFile('curl-ca-bundle.crt')
.SetUserAgent(ChromeUserAgent)
.SwitchRecvToString
.Perform;
Interesting, but should make a fake server too. Or at least utilize some well-known API.
I think you can use this api:
https://jsonplaceholder.typicode.com/