Hi
I want to pass Token & Gstin in Headers and below data as a body using Restsharp
{
"supplyType": "O",
"subSupplyType": "1",
"subSupplyDesc": "",
"docType": "INV",
"docNo": "sum/1/24/79",
"docDate": "07/07/2017",
"fromGstin": "29AAFCC9980M1ZR",
"fromTrdName": "welton",
"fromAddr1": "2ND CROSS NO 59 19 A",
"fromAddr2": "GROUND FLOOR OSBORNE ROAD",
"fromPlace": "FRAZER TOWN",
"fromPincode": 560090,
"actFromStateCode": 29,
"fromStateCode": 29,
"toGstin": "29AEKPV7203E1Z9",
"toTrdName": "sthuthya",
"toAddr1": "Shree Nilaya",
"toAddr2": "Dasarahosahalli",
"toPlace": "Beml Nagar",
"toPincode": 560090,
"actToStateCode": 29,
"toStateCode": 27,
"transactionType": 4,
"otherValue": "0",
"totalValue": 56099,
"cgstValue": 0,
"sgstValue": 0,
"igstValue": 300.67,
"cessValue": 400.56,
"cessNonAdvolValue": 400,
"totInvValue": 68358,
"transporterId": "",
"transporterName": "",
"transDocNo": "",
"transMode": "1",
"transDistance": "100",
"transDocDate": "",
"vehicleNo": "PVC1234",
"vehicleType": "R",
"itemList": [
{
"productName": "Wheat",
"productDesc": "Wheat",
"hsnCode": 1001,
"quantity": 4,
"qtyUnit": "BOX",
"cgstRate": 0,
"sgstRate": 0,
"igstRate": 3,
"cessRate": 3,
"cessNonadvol": 0,
"taxableAmount": 5609889
}
]
}
Thanks
Naimish MakwanaPosted Apr 17, 2024, 12:06 PM
Sure, I can help you with that. Here’s how you can use RestSharp to make a POST request with headers and a JSON body:
Please replace
"http://example.com","your_token_here", and"your_gstin_here"with your actual values. This code will send a POST request to the specified URL with the provided headers and JSON body. The response from the server will be stored in theresponsevariable. You can then check the status of the request and parse the response as needed.Thanks