<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>API on Shaowen Chen's Website</title><link>https://www.chenshaowen.com/en/tags/api/</link><description>Recent content in API on Shaowen Chen's Website</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>&amp;copy;2016 - {year}, All Rights Reserved.</copyright><lastBuildDate>Tue, 20 Nov 2018 00:00:00 +0000</lastBuildDate><sy:updatePeriod>weekly</sy:updatePeriod><atom:link href="https://www.chenshaowen.com/en/tags/api/atom.xml" rel="self" type="application/rss+xml"/><item><title>API of Serializer and ViewSet in restframework</title><link>https://www.chenshaowen.com/en/blog/api-of-viewset-and-serializer-in-rest-framework.html</link><pubDate>Tue, 20 Nov 2018 00:00:00 +0000</pubDate><atom:modified>Tue, 20 Nov 2018 00:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/api-of-viewset-and-serializer-in-rest-framework.html</guid><description>1. Serializer 1.1 Data Validation When deserializing data, the validity of the data needs to be checked. At this point you can call is_valid() for validation, and if a validation error occurs, you can get the error message from the .errors attribute. For example:
1 2 3 4 serializer.is_valid() # False serializer.</description><dc:creator>微信公众号</dc:creator><category>Django</category><category>Python</category><category>API</category><category>Interface</category><category>R&amp;D</category></item><item><title>ViewSet and Serializer in restframework</title><link>https://www.chenshaowen.com/en/blog/viewset-and-serializer-in-rest-framework.html</link><pubDate>Sun, 18 Nov 2018 00:00:00 +0000</pubDate><atom:modified>Sun, 18 Nov 2018 00:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/viewset-and-serializer-in-rest-framework.html</guid><description>1. View Class in Django First, recall how Django handles a request. After receiving a request, Django creates a handler of type WSGIHandler, and the handler controls the entire processing flow.
So how are the request URL and the View associated with each other?
Django first loads the URLconf according to the ROOT_URLCONF setting, then matches the URLpatterns in the URLconf one by one in order, stopping as soon as a match is found.</description><dc:creator>微信公众号</dc:creator><category>Django</category><category>Python</category><category>API</category><category>Framework</category><category>Interface</category><category>R&amp;D</category></item><item><title>Using axios in Vue</title><link>https://www.chenshaowen.com/en/blog/using-axios-in-vue.html</link><pubDate>Mon, 25 Jun 2018 15:00:00 +0000</pubDate><atom:modified>Mon, 25 Jun 2018 15:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/using-axios-in-vue.html</guid><description>1. Installing axios Install with npm 1 npm install axios --save There are two ways to register it globally: Bind it to the prototype 1 2 import axios from &amp;#34;axios&amp;#34;; Vue.prototype.axios = axios; With this approach, every Vue object gets a new axios object. 1 2 3 this.axios.post(apiUrl).then((res) =&amp;gt; {</description><dc:creator>微信公众号</dc:creator><category>Frontend</category><category>Interface</category><category>API</category><category>Vuejs</category><category>Axios</category><category>R&amp;D</category></item><item><title>API Rate Limiting for Backend Services</title><link>https://www.chenshaowen.com/en/blog/rate-limiting-of-api.html</link><pubDate>Thu, 11 Jan 2018 00:00:00 +0000</pubDate><atom:modified>Thu, 11 Jan 2018 00:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/rate-limiting-of-api.html</guid><description>1. Flow Control Caching, degradation, and rate limiting are common methods for protecting high-concurrency systems. Caching trades space for time and cuts the time spent on CPU and network calls; degradation protects the high availability of core services by delaying or refusing to handle non-core requests during peak periods; rate</description><dc:creator>微信公众号</dc:creator><category>API</category><category>Microservices</category><category>R&amp;D</category><category>Architecture</category><category>Rate Limiting</category></item><item><title>API Interface Specification</title><link>https://www.chenshaowen.com/en/blog/api-interface-specification.html</link><pubDate>Fri, 01 Dec 2017 00:00:00 +0000</pubDate><atom:modified>Fri, 01 Dec 2017 00:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/api-interface-specification.html</guid><description>In the process of Web application development, backend developers need to deliver API interfaces frequently, and frontend developers need to call API interfaces frequently. To lower communication costs and prevent possible security risks, and following the principle of convention over configuration, it is necessary to standardize the API specification. Restful</description><dc:creator>微信公众号</dc:creator><category>Django</category><category>Interface</category><category>API</category><category>R&amp;D</category><category>Specification</category></item><item><title>Error Code Design and Unified Exception Handling in Django</title><link>https://www.chenshaowen.com/en/blog/error-code-design-and-unified-processing-in-django.html</link><pubDate>Mon, 30 Oct 2017 21:50:33 +0000</pubDate><atom:modified>Mon, 30 Oct 2017 21:50:33 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/error-code-design-and-unified-processing-in-django.html</guid><description>I currently use Django for SaaS development, and I develop and maintain several SaaS applications at the same time. Many SaaS applications have agreed-upon error codes, some used to handle login state, others to mark business logic status. For a feature that is so strongly shared across projects, it is</description><dc:creator>微信公众号</dc:creator><category>Django</category><category>Python</category><category>Error Codes</category><category>Middleware</category><category>R&amp;D</category><category>Learning</category><category>API</category><category>Best Practices</category></item><item><title>Axios ajax</title><link>https://www.chenshaowen.com/en/blog/axios-ajax.html</link><pubDate>Fri, 04 Aug 2017 07:07:11 +0000</pubDate><atom:modified>Fri, 04 Aug 2017 07:07:11 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/axios-ajax.html</guid><description>1. Basic Concepts 1.1 Ajax Ajax stands for &amp;ldquo;Asynchronous JavaScript and XML&amp;rdquo;. At its core it is made up of the JavaScript, XmlHttpRequest, and DOM objects: through the XmlHttpRequest object it sends an asynchronous request to the server, gets data back from the server, and then uses JavaScript to manipulate</description><dc:creator>微信公众号</dc:creator><category>Frontend</category><category>Tools</category><category>Axios</category><category>Ajax</category><category>API</category></item><item><title>Permission Management in Django REST Framework</title><link>https://www.chenshaowen.com/en/blog/permissions-of-django-rest-framework.html</link><pubDate>Fri, 07 Jul 2017 06:47:19 +0000</pubDate><atom:modified>Fri, 07 Jul 2017 06:47:19 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/permissions-of-django-rest-framework.html</guid><description>1. Permission Management in DRF Permission management in Django REST Framework consists of two parts.
One is Authentication. It specifies how the user is authenticated, obtaining request.user. The other is Permissions. It performs permission control over Django resources and user categories. 1.1 Authentication Methods The relevant source is in the rest_framework/authentication.</description><dc:creator>微信公众号</dc:creator><category>Django</category><category>Python</category><category>Backend</category><category>Security</category><category>API</category><category>Permissions</category><category>R&amp;D</category></item><item><title>Getting Started with Django REST Framework</title><link>https://www.chenshaowen.com/en/blog/101-of-django-rest-framework.html</link><pubDate>Thu, 22 Jun 2017 23:50:15 +0000</pubDate><atom:modified>Thu, 22 Jun 2017 23:50:15 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/101-of-django-rest-framework.html</guid><description>In the SaaS development I work on, there is a fairly high demand for development efficiency. From project initiation, prototype design and evaluation, requirements confirmation, frontend design, and backend development through to final acceptance, we complete one iteration in just a few weeks. Guided by agile development, we began rolling</description><dc:creator>微信公众号</dc:creator><category>Data</category><category>Backend</category><category>Interface</category><category>Django</category><category>Python</category><category>API</category><category>R&amp;D</category></item><item><title>Apidoc: Practice and Automated Generation</title><link>https://www.chenshaowen.com/en/blog/practice-and-automation-generation-of-apidoc.html</link><pubDate>Wed, 14 Jun 2017 17:22:45 +0000</pubDate><atom:modified>Wed, 14 Jun 2017 17:22:45 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/practice-and-automation-generation-of-apidoc.html</guid><description>In a frontend/backend separated architecture, API documentation changes hands frequently. When third-party interfaces are involved, API and documentation changes can be even faster in multi-party collaboration scenarios. To make maintaining the API and handing over documentation easier, here is a documentation generation tool worth recommending — apidoc. 1. Introduction to</description><dc:creator>微信公众号</dc:creator><category>Django</category><category>Interface</category><category>API</category><category>Documentation</category><category>R&amp;D</category></item><item><title>Django Restful APIs with Tastypie</title><link>https://www.chenshaowen.com/en/blog/restful-api-of-using-django-tastypie.html</link><pubDate>Tue, 13 Jun 2017 21:31:13 +0000</pubDate><atom:modified>Tue, 13 Jun 2017 21:31:13 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/restful-api-of-using-django-tastypie.html</guid><description>1. Restful REST is short for Representational State Transfer, meaning &amp;ldquo;representation state transfer&amp;rdquo;. Restful is a development philosophy and a software architecture style for the World Wide Web. 1.1 Features of Restful Abstract resources Images, text, songs, and videos are all resource entities; on the network they are abstracted as</description><dc:creator>微信公众号</dc:creator><category>Django</category><category>Python</category><category>Interface</category><category>API</category><category>Tastypie</category><category>R&amp;D</category></item></channel></rss>