Konversi Kode Python ke Java
import http
import ssl
from urllib.parse import urlparse
import requests
clientCrt = "<SSL files path>/GDLAPPSPublicCertificate.cer"
clientKey = "<SSL files path>/GDLAPPSPrivateCertificateKey.key"
url = "https://gdlapps.naturesweet.com/ws/simple/getDailyQualityYield"
request_url="/ws/simple/getDailyQualityYield"
method="GET"
headers = {'Content-type': 'application/json'}
body={}
context = ssl.SSLContext()
context.load_cert_chain(certfile=clientCrt,keyfile=clientKey)
connection = http.client.HTTPSConnection(urlparse(url).hostname, port=443, context=context)
connection.request(method=method, url=url,headers=headers,body=body)
response = connection.getresponse()
print(response.status, response.reason)
data = response.read()
print(data)
Paresh Vasani