Connect to dynamic URL within OData in SAP project

SAP HANASAPSAP Basis

You can try and create a URL in your code which you can read from config or XML.

Here is a sample code snippet −

String uri = // Can read from config or anywhere
string odQuery = "?$format=json"
var req = WebRequest.Create(uri+"/"+ odQuery);
req.Method = "GET";
var streamreader = new StreamReader(stream: request.GetResponse().GetResponseStream());
string response = streamreader.ReadToEnd(); //json response

This is a sample code snippet but you can modify it as per your use case.

raja
Published on 07-Dec-2017 15:36:30
Advertisements