Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Building PowerApps with Naver Map API
public static class StaticMapHttpTrigger
{
[FunctionName("StaticMapHttpTrigger")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = "staticmap")] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
var qs = req.QueryString.ToString();
var requestUri = $"https://naveropenapi.apigw.ntruss.com/map-static/v2/raster-cors{qs}";
var uri = new Uri(requestUri);
var content = default(byte[]);
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Referer", "http://localhost");
content = await client.GetByteArrayAsync(requestUri).ConfigureAwait(false);
}
return new FileContentResult(content, "image/png");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.