How should you complete the code segment?

DRAG DROP

You are a developer for a Software as a Service (SaaS) company. You develop solutions that provide the ability to send notifications by using Azure Notification Hubs.

You need to create sample code that customers can use as a reference for how to send raw notifications to Windows Push Notification Services (WNS) devices. The sample code must not use external packages.

How should you complete the code segment? To answer, drag the appropriate code segments to the correct locations. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point.

Answer:

Explanation:

Graphical user interface, text, application, email

Description automatically generated

Box 1: windows

Example code:

var request = new HttpRequestMessage(method, $"{resourceUri}?api-version=2017-04"); request.Headers.Add("Authorization", createToken(resourceUri, KEY_NAME, KEY_VALUE));

request.Headers.Add("X-WNS-Type", "wns/raw"); request.Headers.Add("ServiceBusNotification-Format", "windows"); return request;

Box 2: application/octet-stream

Example code capable of sending a raw notification:

string resourceUri =

$"https://{NH_NAMESPACE}.servicebus.windows.net/{HUB_NAME}/messages/"; using (var request = CreateHttpRequest(HttpMethod.Post, resourceUri)) {

request.Content = new StringContent(content, Encoding.UTF8, "application/octet-stream"); request.Content.Headers.ContentType.CharSet = string.Empty; var httpClient = new HttpClient();

var response = await httpClient.SendAsync(request); Console.WriteLine(response.StatusCode); }

Latest AZ-204 Dumps Valid Version with 254 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments