Company
Date Published
Author
John Sheehan
Word count
1054
Language
English
Hacker News points
None

Summary

The Twilio REST API is used in Windows 8 Metro-style applications by utilizing the `System.Net.Http.HttpClient` class, which provides a simple API with full async support for making requests to the Twilio REST API. The `SendMessage` method uses this class to send an SMS message from a specified "from" number to another number, with the message body being sent as form data. To authenticate the request, Basic HTTP authentication is used, where the account SID and auth token are passed in the Authorization header. The response from the API is then parsed using LINQ to XML. Additionally, the `SendMessage` method can be made asynchronous by decorating it with the `async` keyword and using the `PostAsync` method, allowing the app to remain responsive to the end user.