Method and device called by http interface

A technology of interface calling and interface, applied in the computer field, can solve problems such as flexibility, maintainability, poor readability, and high code coupling, and achieve the effects of strong maintainability, clear business logic, and improved efficiency

CN108737474BActive Publication Date: 2021-04-30BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Publication Date
2021-04-30

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The embodiments of the present invention provide a method and device for invoking an HTTP interface, which can solve the problems of high code coupling and poor flexibility, maintainability, and readability during the development process using a third-party toolkit. The method includes: when the client is started, scanning the hypertext transfer protocol HTTP interface according to the configuration class path and the package path to obtain the callable HTTP interface; performing agent registration on the callable HTTP interface.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the technical field of computers, in particular to a method and a device for invoking an HTTP interface. Background technique

[0002] HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol) is a set of rules for computers to communicate through the network. When the client calls the server, the server provides an HTTP interface, and the client needs to write different hardware based on different URLs and request parameters. Code, at this time, if there are many different interfaces, you need to write a separate HTTP request code for each interface, which is very inflexible.

[0003] At present, the most common solution is to provide a public request tool class. When using third-party data in daily development, the third party may provide several ways to obtain data, such as HTTP and remote calling. Usually the HTTP method is the simplest and most favored by developers. When using the HTTP method to obtain data, you ne...

Examples

Embodiment Construction

[0036] Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

[0037] Because the technical solution of the embodiment of the present invention adopts HTTP service-oriented interface programming, that is, the business of the remote server that the client depends on is first extracted as an interface, and the business of the remote server is specifically realized through the implementation class of the interface. When the server realize...