RestFUL APIs Flashcards
MVC
Model
View
Controller
חלוקה רעיונית
AJAX
Asynchronous
JavaScript
And
XML
AJAX=
היא טכניקה ליצירת יישומי רשת אינטראקטיביים המבוססים על קוד המורץ במסגרת דף HTML בודד, ולא כיישום מרובה דפים, כמקובל בסביבת ה-Web
ASP.NET
ASP.NET=
היא טכנולוגית קוד פתוח ליישומי אינטרנט בצד השרת, שפותחה על ידי חברת מיקרוסופט
ASP.NET is an open-source, server-side web-application framework designed for web development to produce dynamic web pages
ASP.NET משלבת בנוסף טכנולוגיית MVC, שמאפשרת לפתח אפליקציות רשת במהירות ובקלות
ASP.NET MVC – allows for building web pages using the model–view–controller design pattern.
MVC/ Model View Controller
MVC/ Model View Controller=
תבנית עיצוב בהנדסת תוכנה המשמשת להפשטת יישום כלשהו
Model מודל
המודל הוא יצוג מסוים של המידע עליו פועל היישום
View תצוגה
ממיר את נתוני המודל לייצוג המאפשר למשתמש לבצע פעולה כלשהי
Controller בקר
תפקידו לעבד ולהגיב לאירועים המתרחשים בתצוגה, כתגובה לפעולה של המשתמש
ASP.NET Web API
API = Application Programming Interface is a
connection between computers or between computer programs.
ASP.NET Web API=
A framework for building Web APIs on top of the .NET Framework
Web API=
is an application programming interface for either a web server or a web browser.
A web API that obeys the REST constraints is informally described as RESTful. RESTful web APIs are typically loosely based on HTTP methods to access resources via URL-encoded parameters and the use of JSON or XML to transmit data.
Web API Server side
API = Application Programming Interface is a
connection between computers or between computer programs.
Web API Server side=
server-side web API is a programmatic interface defines request–response message system, typically in JSON or XML
exposed via HTTP-based web server
Web API Client side
API = Application Programming Interface is a
connection between computers or between computer programs.
Web API Client side=
client-side web API is a programmatic interface to extend functionality within a web browser or other HTTP client
REST
Representational state transfer
REST/ Representational state transfer=
software architectural style
that was created to guide the design and development of the architecture for the World Wide Web
A web API that obeys the REST constraints is informally described as RESTful. RESTful web APIs are typically loosely based on HTTP methods to access resources via URL-encoded parameters and the use of JSON or XML to transmit data.
It provides operations (HTTP methods) such as GET, POST, PUT, and DELETE as request, and response as: - 200 = ok - 404 = server not found - 500 = error
HTTP methods
request/ response
HTTP methods =
Request methods:
GET, POST, PUT, DELETE
Response status codes:
1XX (informational)
2XX (successful) request was successfully received, understood, and accepted
3XX (redirection)
4XX (client error) request contains bad syntax or cannot be fulfilled
5XX (server error) server failed to fulfill an apparently valid request
- 200 = ok
- 404 = website not found
- 500 = server error
HTTP
Hypertext Transfer Protocol
HTTP = Hypertext Transfer Protocol =
protocol used to transfer data over the web.
XML
Extensible Markup Language
XML=Extensible Markup Language=
markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.
JSON
JavaScript Object Notation
JSON - JavaScript Object Notation=
data interchange format
that uses human-readable text to store and transmit data objects,
common data format with a diverse range of functionality in data interchange including communication of web applications with servers
body html
body html=
element contains all the contents of an HTML document
HTML= hypertext markup language
HTML- hypertext markup language=
a formatting system for displaying material retrieved over the Internet.
is called hypertext markup language because it is a language that allows users to organize, improve the appearance of, and link text with data on the internet
What are the 10 basic HTML tags
What are the 10 basic HTML tags=
This is the root element tag. ... ... ... ... <h1></h1> ... <p></p> ... <a></a> ... <img>
Basic HTML - What are the types of HTML tags?
Tag Description
Basic HTML
Tag Description
Defines the document type
Basic HTML - What are the types of HTML tags?
Tag Description
Basic HTML
Tag Description
Defines an HTML document
Basic HTML - What are the types of HTML tags?
Tag Description
Basic HTML
Tag Description
Contains metadata/information for the document
Basic HTML - What are the types of HTML tags?
Tag Description
Basic HTML
Tag Description
Defines a title for the document
Flag variable
Flag variable is used as a signal in programming to let the program know that a certain condition has met.
It usually acts as a boolean variable indicating a condition to be either true or false.
An event handler, in C#
method //
callback routine//
An event handler, in C#
- is a method that contains the code
that gets executed in response
to a specific event
that occurs in an application. - is a callback routine that operates asynchronously and handles inputs received into a program (events)
- event Handling is the mechanism that controls the event and decides what should happen if an event occurs.
Event handlers are used in graphical user interface (GUI) applications to handle events such as button clicks and menu selections, raised by controls in the user interface
How do you raise an event in C#?
How do you raise an event in C#?
First you check the event against
a null value
to ensure that the caller has registered with the event, and then you fire the event by specifying the event by name as well as any required parameters as defined by the associated delegate. MyEvent(message);
difference between an event and a delegate
difference between an event and a delegate
Delegate is a function pointer.
An event is dependent on a delegate and cannot be created without delegates. Event is a wrapper around delegate instance to prevent users of the delegate from resetting the delegate and its invocation list and only allows adding or removing targets from the invocation list
Why are delegates used?
Why are delegates used?
Delegates allow methods to be passed as parameters.
Delegates can be used to define callback methods.
REST API
RESTful web services
Web API
RESTful web APIs
REST API=
it is service on the server side that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services.
סדרה של חוקים, הקובעים מה השירות מקבל ומה הוא מחזיר, על איזה פרוטוקול תקשורת הוא עובד ועוד
RESTful web services=
is a lightweight, maintainable, and scalable service that is built on the REST architecture.
Restful Web Service, expose API from your application in a secure, uniform, stateless manner to the calling client.
The underlying protocol for REST is HTTP. REST stands for REpresentational State Transfer.
Web API=
Web API is an application programming interface on WWW
RESTful web APIs=
based on HTTP methods to access resources via URL-encoded parameters and the use of JSON or XML to transmit data.
It provides operations (HTTP methods) such as GET, POST, PUT, and DELETE.
RESTful web APIs
REpresentational State Transfer
RESTful web APIs=
based on HTTP methods to access resources via URL-encoded parameters and the use of JSON or XML to transmit data.
It provides operations (HTTP methods) such as GET, POST, PUT, and DELETE.
API is an application programming interface
REpresentational State Transfer
Web API
Web API=
Web API is an Application Programming Interface
ADO.NET
ActiveX Data Objects
ADO.NET=
ADO is the acronym for ActiveX Data Objects
ADO.NET is a set of classes (a framework) to interact with data sources such as databases and XML files.
NET applications that use ADO.NET to connect to a database, execute commands and retrieve data from the database
LINQ
SingleOrDefault
SingleOrDefault
The method returns a single specific element of a sequence.
FirstOrDefault returns a first item of potentially multiple (or default if none exists).
char[] arr
C#
char[] arr
array of pointers
An array of pointers to strings is an array of character pointers where each pointer points to the first character of the string or the base address of the string.
Package Manager
Package Manager =
מערכת המאפשרת להתקין ספריה בתוך פרויקט הספריה יכולה לכלול קבצים DLL-ים סקריפטים ועוד לדוט נט יש NuGet
מודל שכבות ע”י
Entity Framework
מודל שכבות ע”י
Entity Framework
צרו מההתחלה את כל מודל השכבות על המודל לכלול DAL = BLL = DTOs = UI =
get
set
get / set =
decimal? short?
decimal? short?
טיפוס נתונים עם סימן שאלה מאפשרים להכניס ערכים של
null
נקראים
Nullable type
Functions: ???
public
private
protected
Functions:
public
private
protected
CORS
Cross-Origin Resource Sharing
CORS
Cross-Origin Resource Sharing
is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served.
Domainy.com receives that request and will respond back with either: Access-Control-Allow-Origin: http://domainx.com. Access-Control-Allow-Origin: * (meaning all domains are allowed) An error if the cross-origin requests are not allowed.
Anabel CORS:
- Open Internet Information Service (IIS) Manager.
- Right click the site you want to enable CORS for and go to Properties.
- Change to the HTTP Headers tab.
- In the Custom HTTP headers section, click Add.
- Enter Access-Control-Allow-Origin as the header name.
- Enter * as the header value.
- Click Ok twice.
Cовместное использование ресурсов между разными источниками.
Tехнология современных браузеров, которая позволяет предоставить веб-страницам доступ к ресурсам другого домена
Суть технологии CORS:
Есть три домена, позволяющие загрузить ресурсы с сервера Z. Для того, чтобы это стало возможным, веб-серверу Z, который отдает контент, достаточно указать в заголовке ответа Access-Control-Allow-Origin список доверенных доменов: A, B, C. Тогда для страниц этих доменов не будут действовать ограничения принципа одинакового источника на запрашиваемые страницы:
Access-Control-Allow-Origin: A, B, C
Правило ограничения домена:
(Same Origin Policy, в переводе с англ. — «Принцип одинакового источника») — это важная концепция безопасности для некоторых языков программирования на стороне клиента, таких как JavaScript. Политика разрешает сценариям, находящимся на страницах одного сайта, доступ к методам и свойствам друг друга без ограничений, но предотвращает доступ к большинству методов и свойств для страниц на разных сайтах. Одинаковые источники — это источники, у которых совпадают три признака:
- домен;
- порт;
- протокол.
Dependency injection
Dependency injection=
is a software design pattern. It allows us to develop loosely-coupled code.
Dependency Injection reduces the hard-coded dependencies among your classes by injecting those dependencies at run time instead of design time technically.
jQuery
library
jQuery =
is a lightweight, “write less, do more”, JavaScript library. The purpose of jQuery is to make it much easier to use JavaScript on your website.