Connect to dynamic URL within OData in SAP project


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.

Updated on: 13-Feb-2020

257 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements