import requests
url = "http://host1.open.uom.lk:8080"
response = requests.get(f"{url}/api/products/")
data = response.json()["data"]
for i in range(0, len(data)):
print(data[i])
print(f"Total number of products: {len(data)}")
1. හරිද දන්නෙනම් නැ. මාත් තාම beginner
Code:import requests url = "http://host1.open.uom.lk:8080" response = requests.get(f"{url}/api/products/") data = response.json()["data"] for i in range(0, len(data)): print(data[i]) print(f"Total number of products: {len(data)}")
response eka e kivva format ekatada dala thiyenne?mekah waradi kiynwane.. mkkd waradda kiyala dnnwada kuru hari
matat okama thamayi dannette ? kauruhri krpu kenek inwadresponse e
import requests
BASE_URL = 'http://host1.open.uom.lk:8080'
updated_entity = {
"productName": "Araliya Basmathi Rice",
"description": "White Basmathi Rice imported from Pakistan. High-quality rice with extra fragrance. Organically grown.",
"category": "Rice",
"brand": "Araliya",
"expiredDate": "2023.05.04",
"manufacturedDate": "2022.02.20",
"batchNumber": 324567,
"unitPrice": 1020,
"quantity": 200,
"createdDate": "2022.02.24"
}
response = requests.put(f"{BASE_URL}/api/products", json=updated_entity)
print(response.json())
1. හරිද දන්නෙනම් නැ. මාත් තාම beginner
Code:import requests url = "http://host1.open.uom.lk:8080" response = requests.get(f"{url}/api/products/") data = response.json()["data"] for i in range(0, len(data)): print(data[i]) print(f"Total number of products: {len(data)}")