وبلاگ بلیان

Practical ASP.NET Web API / [delta

معرفی کتاب «Practical ASP.NET Web API / [delta» نوشتهٔ Badrinarayanan Lakshmiraghavan، منتشرشده توسط نشر Apress : Springer e-books : Imprint: Apress : Springer e-books در سال 2013. این کتاب در 20 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Practical ASP.NET Web API / [delta» در دستهٔ بدون دسته‌بندی قرار دارد.

__Practical ASP.NET Web API__ provides you with a hands-on and code-focused demonstration of the ASP.NET Web API in action. From the very beginning, you'll be writing working code in order to see best practices and concepts in action. As the book progresses, the concepts and code will become more sophisticated. Beginning with an overview of the web service model in general and Web API in particular, you'll progress quickly to a detailed exploration of the request binding and response formatting that lie at the heart of Web API. You'll investigate various scenarios and see how they can be manipulated to achieve the results you need. Later in the book more sophisticated themes will be introduced that will set your applications apart from the crowd. You'll learn how you can validate the request messages on arrival, how you can create loosely coupled controllers, extend the pipeline processing to compartmentalize your code for security and unit testing before being put onto a live hosting server. Contents at a Glance 3 Contents 323 About the Author 328 About the Technical Reviewer 329 Introduction 4 Chapter 1: Building a Basic Web API 8 1.1 Choosing ASP.NET Web API or WCF 9 1.2 Exposing an In-Memory List over HTTP 11 1.3 Choosing Configuration over Convention 16 1.4 Playing by the Rules of HTTP 22 1.4.1 Retrieving Resource(s) 23 1.4.2 Creating a Resource with a Server-Generated Identifier 26 1.4.3 Creating a Resource with a Client-Supplied Identifier 27 1.4.4 Overwriting a Resource 28 1.4.5 Updating a Resource 28 1.4.6 Partially Updating (Patching) a Resource 29 1.4.7 Deleting a Resource 31 Summary 32 Chapter 2: Debugging and Tracing 33 2.1 Using Fiddler for Web Debugging 33 2.2 Capturing Console App Traffic through Fiddler 35 2.3 Capturing HTTPS Traffic in Fiddler 37 2.4 Composing and Submitting Requests in Fiddler 39 2.5 Using F12 Developer Tools in Internet Explorer 42 2.6 Using Developer Tools in Chrome 43 2.7 Enabling ASP.NET Web API Tracing 44 2.8 Creating a Custom Trace Writer 46 2.9 Tracing Entry and Exit 48 2.10 Tracing from Your Code 53 2.11 Tracing Request and Response Messages 57 Summary 59 Chapter 3: Media-Type Formatting CLR Objects 60 3.1 Listing the Out-of-Box Media Formatters 61 3.2 Understanding Conneg 62 3.3 Requesting a Content Type through the Query String 66 3.4 Requesting a Content Type through the Header 68 3.5 Implementing a Custom Media Type Mapping 69 3.6 Overriding Conneg and Returning JSON 71 3.7 Piggybacking on Conneg 71 3.8 Creating a Custom Media Formatter 72 3.9 Extending an Out-of-Box Media Formatter 77 3.10 Controlling Which Members Are Serialized 83 3.10.1 Blacklisting Members 83 3.10.2 Whitelisting Members 84 3.11 Controlling How Members Are Serialized 85 3.11.1 Controlling Member Names 85 3.11.2 Prettifying JSON 85 3.12 Returning Only a Subset of Members 86 Summary 88 Chapter 4: Customizing Response 89 4.1 Negotiating Character Encoding 89 4.2 Supporting DBCS Character Encoding (Shift JIS) 92 4.3 Negotiating Content Encoding (Compression) 94 4.4 Negotiating Language 104 4.4.1 Internationalizing the Messages to the User 104 4.4.2 Internationalizing the Decimal Separators of Numbers 108 4.4.3 Internationalizing the Dates 114 Summary 117 Chapter 5: Binding an HTTP Request into CLR Objects 118 5.1 Reading the Raw HTTP Request 119 5.2 Reading the HTTP Request into a CLR Type 120 5.3 Binding the HTTP Request to Simple Types 122 5.4 Binding the HTTP Request to Complex Types 124 5.5 Binding the HTTP Request to a Collection 126 5.6 Binding the Form Data 127 5.6.1 Binding to FormDataCollection 128 5.6.2 Binding to Custom Class 131 5.6.3 Binding to a Simple Type 133 5.7 Binding dd/MM/yyyy Dates 135 5.8 Using TypeConverter 139 5.9 Creating a Custom Value Provider 142 5.10 Creating a Custom Model Binder 147 5.11 Creating a Custom Parameter Binder 150 5.12 Creating a Custom Media Formatter 155 Summary 158 Chapter 6: Validating Requests 159 6.1 Validation Using Data Annotations 159 6.2 Handling Validation Errors 164 6.3 Extending an Out-of-the-Box Validation Attribute 170 6.4 Creating Your Own Validation Attribute 172 6.5 Implementing the IValidatableObject Interface 174 Summary 175 Chapter 7: Managing Controller Dependencies 177 7.1 Taking Dependency on the Entity Framework 177 7.2 Inverting Entity Framework Dependencies 184 7.3 Using the Repository Pattern 187 7.4 Using the Generic Repository Pattern 190 7.5 Mapping a Domain to Data Transfer Object (DTO) 197 7.6 Injecting Dependencies Using StructureMap 201 7.7 Unit-Testing the Controller 204 Summary 211 Chapter 8: Extending the Pipeline 212 8.1 Creating a Message Handler 213 8.2 Creating an Exception Filter 219 8.3 Creating an Action Filter to Handle Concurrency 221 8.4 Creating a Controller Selector for Versioning 226 Summary 230 Chapter 9: Hosting ASP.NET Web API 231 9.1 Web Hosting ASP.NET Web API 231 9.2 Self-Hosting ASP.NET Web API 245 9.3 In-Memory Hosting ASP.NET Web API 248 Summary 253 Chapter 10: Securing ASP.NET Web API 254 10.1 Implementing Direct Authentication 254 10.2 Implementing Brokered Authentication 263 10.3 Authorizing Requests 270 Summary 272 Chapter 11: Consuming ASP.NET Web API 274 11.1 Calling a Web API from a Console Application 274 11.2 Calling a Web API from a WPF Application 278 11.3 Calling a Web API from JavaScript 285 Summary 293 Chapter 12: Building a Performant Web API 294 12.1 Creating Asynchronous Action Methods 294 12.2 Pushing Real-time Updates to the Client 298 12.3 Implementing Simple Web Caching 305 Summary 313 Index 314 www.it-ebooks.info IT eBooks Practical ASP.NET Web API provides you with a hands-on and code-focused demonstration of the ASP.NET Web API in action. From the very beginning, you'll be writing working code in order to see best practices and concepts in action. As the book progresses, the concepts and code will become more sophisticated. Beginning with an overview of the web service model in general and Web API in particular, you'll progress quickly to a detailed exploration of the request binding and response formatting that lie at the heart of Web API. You'll investigate various scenarios and see how they can be manipulated to achieve the results you need. Later in the book more sophisticated themes will be introduced that will set your applications apart from the crowd. You ll learn how you can validate the request messages on arrival, how you can create loosely coupled controllers, extend the pipeline processing to compartmentalize your code for security and unit testing before being put onto a live hosting server
دانلود کتاب Practical ASP.NET Web API / [delta