CN109005163A - A kind of HTTP dynamic requests service calling method - Google Patents

A kind of HTTP dynamic requests service calling method Download PDF

Info

Publication number
CN109005163A
CN109005163A CN201810804414.8A CN201810804414A CN109005163A CN 109005163 A CN109005163 A CN 109005163A CN 201810804414 A CN201810804414 A CN 201810804414A CN 109005163 A CN109005163 A CN 109005163A
Authority
CN
China
Prior art keywords
server
mode
calling
http dynamic
call
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810804414.8A
Other languages
Chinese (zh)
Other versions
CN109005163B (en
Inventor
罗奔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hongqiao Hi Tech Group Co ltd
Original Assignee
Zhuhai Hongqiao Hi Tech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Hongqiao Hi Tech Co Ltd filed Critical Zhuhai Hongqiao Hi Tech Co Ltd
Priority to CN201810804414.8A priority Critical patent/CN109005163B/en
Publication of CN109005163A publication Critical patent/CN109005163A/en
Application granted granted Critical
Publication of CN109005163B publication Critical patent/CN109005163B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present invention relates to a kind of HTTP dynamic requests service calling methods.It is the following steps are included: S1: server-side configures application module information;S2: front end applications obtain loading module data from server-side;S3: by loading module data that front end applications are obtained from server-side, end page face is loaded by unified call method and format before application;S4: it is executed in end page face call server-side method before application;S5: server-side parses front end applications by unified mode and requests, and obtains element needed for calling corresponding interface;S6: server-side calls corresponding interface;S7: server-side returned data.Present invention can apply to need in the application item of dynamic call server-side method, the complexity for calling service is reduced and convenient for its maintenance.Specifically, the present invention is by taking out service call mode, the structure and transformat of unified call method, front end applications can be in a manner of configuration in different business scene unified call corresponding with service, and then reduces complexity, maintains easily.

Description

A kind of HTTP dynamic requests service calling method
Technical field
The invention belongs to field of computer technology more particularly to a kind of service call technologies, concretely relate to one kind HTTP dynamic requests service calling method.
Background technique
With the development of mobile network's technology, application program rapidly becomes the mainstream program in terminal.User can be used The application of each Internet Service Provider is communicated with corresponding server-side, to realize the items of the Internet Service Provider Business.Specifically, user is interacted by each page in the interior opening of application with server-side, completion acquisition business information, Starting and control business procedure submit each processes such as business datum.
But in the prior art, each business scenario will distinguish write method tune in particular for the module of dynamic rendering It is cumbersome with service (respectively calling corresponding service interface in the on-demand write method of each business scenario respectively);Separately Outside, the method that different people writes is inconsistent, also results in the difficulty in maintenance.
Summary of the invention
For the deficiencies of the prior art, the present invention provides a kind of HTTP dynamic requests service calling methods.
The technical solution of HTTP dynamic requests service calling method of the invention is as follows:
A kind of HTTP dynamic requests service calling method comprising following steps:
Step S1: server-side configures application module information;
Step S2: front end applications obtain loading module data from server-side;
Step S3: unified calling is pressed in end page face to the loading module data that front end applications are obtained from server-side before application Method and format are loaded;
Step S4: it is executed in end page face call server-side method before application;
Step S5: server-side parses front end applications by unified mode and requests, and obtains element needed for calling corresponding interface;
Step S6: server-side calls corresponding interface;
Step S7: server-side returned data.
HTTP dynamic requests service calling method of the invention by taking out service call mode, unified call method Structure and transformat, front end applications can be in a manner of configurations in different business scene unified call corresponding with service;Comparison passes The method (respectively in the on-demand write method of each business scenario, respectively calling corresponding service interface) of system, using of the invention HTTP dynamic requests service calling method can take out the model that front end applications call service, and be matched by server-side backstage Set so that service URL and parameter etc. can dynamic acquisition, and by unified front end applications method of calling, front end applications can be with In different business scene unified call corresponding with service in a manner of configuration, and then complexity is reduced, maintained easily.
According to a preferred embodiment, in the step S1, server-side configures the mode of application module information are as follows:
In server-side management backstage system, configuration is entirely using involved module and the interface to be called letter Breath.
According to a preferred embodiment, in the step S2, front end applications obtain loading module number from server-side According to mode are as follows:
When opening front end applications, the data using all modules are pulled from server-side, according to the data loading module Render front end page.
According to a preferred embodiment, in the step S5, server-side parses front end applications by unified mode The mode of request are as follows:
Server-side press unified processing model receiving front-end application request, and by server-side configuration application module information when about Fixed mode parses the request received, is converted into element needed for calling corresponding interface.
According to a preferred embodiment, in the step S5, element needed for calling corresponding interface includes service URL and parameter, request method and return type.
According to a preferred embodiment, in the step S5, the request method be POST request mode or GET request mode.
According to a preferred embodiment, in the step S6, server-side calls the mode of corresponding interface are as follows:
Element needed for calling corresponding interface is obtained from the step S5, is assembled into network call format, and execute.
According to a preferred embodiment, in the step S6, using HttpClient mode calling interface.
According to a preferred embodiment, during server-side returned data, if returned data is abnormal, take Business end returns to exception information;Otherwise the data for calling server-side to return are returned into front end page.
Compared with prior art, HTTP dynamic requests service calling method of the invention has the following beneficial effects:
HTTP dynamic requests service calling method of the invention by taking out service call mode, unified call method Structure and transformat, front end applications can be in a manner of configurations in different business scene unified call corresponding with service;Comparison passes The method (respectively in the on-demand write method of each business scenario, respectively calling corresponding service interface) of system, using of the invention HTTP dynamic requests service calling method can take out the model that front end applications call service, and be matched by server-side backstage Set so that service URL and parameter etc. can dynamic acquisition, and by unified front end applications method of calling, front end applications can be with In different business scene unified call corresponding with service in a manner of configuration, and then complexity is reduced, maintained easily.
HTTP dynamic requests service calling method of the invention, which can be applied to, needs answering for dynamic call server-side method In project, the complexity for calling service is reduced and convenient for its maintenance.
Detailed description of the invention
Fig. 1 is the key step schematic diagram of HTTP dynamic requests service calling method of the invention.
Specific embodiment
HTTP dynamic requests service calling method of the invention is described in detail with reference to the accompanying drawing.
Fig. 1 is the key step schematic diagram of HTTP dynamic requests service calling method of the invention;It illustrates the present invention A kind of preferred embodiment of HTTP dynamic requests service calling method.
As shown in Figure 1, a kind of HTTP dynamic requests service calling method comprising following steps:
Step S1: server-side configures application module information.
In the step S1, the mode of server-side configuration application module information are as follows:
In server-side management backstage system, configuration is entirely using involved module and the interface to be called letter Breath.
Step S2: front end applications obtain loading module data from server-side.
In the step S2, front end applications obtain the mode of loading module data from server-side are as follows:
When opening front end applications, the data using all modules are pulled from server-side, according to the data loading module Render front end page.
Step S3: unified calling is pressed in end page face to the loading module data that front end applications are obtained from server-side before application Method and format are loaded.
Step S4: it is executed in end page face call server-side method before application.
Step S5: server-side parses front end applications by unified mode and requests, and obtains element needed for calling corresponding interface.
In the step S5, server-side is in such a way that unified mode parses front end applications request are as follows:
Server-side press unified processing model receiving front-end application request, and by server-side configuration application module information when about Fixed mode parses the request received, is converted into element needed for calling corresponding interface.
Wherein, element needed for calling corresponding interface includes service URL and parameter, request method and return type etc..
Preferably, the request method is POST request mode or GET request mode.
Step S6: server-side calls corresponding interface.
In the step S6, server-side calls the mode of corresponding interface are as follows: obtains from the step S5 and calls correspondence Element needed for interface is assembled into network call format, such as can remove calling interface using HttpClient mode, and execute.
Step S7: server-side returned data.During server-side returned data, if returned data is abnormal, take Business end returns to exception information;Otherwise the data for calling server-side to return are returned into front end page.
HTTP dynamic requests service calling method of the invention, which can be applied to, needs answering for dynamic call server-side method In project, the complexity for calling service is reduced and convenient for its maintenance.
Specifically, HTTP dynamic requests service calling method of the invention is by taking out service call mode, it is unified to adjust With the structure and transformat of method, front end applications can be in a manner of configuration in the corresponding clothes of different business scene unified call Business;It compares traditional method (respectively in the on-demand write method of each business scenario, respectively calling corresponding service interface), uses HTTP dynamic requests service calling method of the invention can take out front end applications and call the model of service, and pass through service End backstage configures so that service URL and parameter etc. can dynamic acquisition, and pass through unified front end applications method of calling, front end Using can be in a manner of configuration in different business scene unified call corresponding with service, and then complexity be reduced, maintained easily.
It should be noted that all features disclosed in this specification or disclosed all methods or in the process the step of, Other than mutually exclusive feature and/or step, it can combine in any way.
In addition, above-mentioned specific embodiment is exemplary, those skilled in the art can opening in the disclosure of invention It gives and finds out various solutions, and these solutions also belong to disclosure of the invention range and fall into protection of the invention Within the scope of.It will be understood by those skilled in the art that description of the invention and its attached drawing be it is illustrative and not constitute to power The limitation that benefit requires.Protection scope of the present invention is defined by the claims and their equivalents.

Claims (9)

1. a kind of HTTP dynamic requests service calling method, which is characterized in that itself the following steps are included:
Step S1: server-side configures application module information;
Step S2: front end applications obtain loading module data from server-side;
Step S3: unified call method is pressed in end page face to the loading module data that front end applications are obtained from server-side before application It is loaded with format;
Step S4: it is executed in end page face call server-side method before application;
Step S5: server-side parses front end applications by unified mode and requests, and obtains element needed for calling corresponding interface;
Step S6: server-side calls corresponding interface;
Step S7: server-side returned data.
2. HTTP dynamic requests service calling method according to claim 1, which is characterized in that in the step S1, The mode of server-side configuration application module information are as follows:
In server-side management backstage system, configuration is entirely using involved module and the interface message to be called.
3. HTTP dynamic requests service calling method according to claim 1, which is characterized in that in the step S2, Front end applications obtain the mode of loading module data from server-side are as follows:
When opening front end applications, the data using all modules are pulled from server-side, are rendered according to the data loading module Front end page.
4. HTTP dynamic requests service calling method according to claim 1, which is characterized in that in the step S5, Server-side is in such a way that unified mode parses front end applications request are as follows:
Server-side presses unified processing model receiving front-end application request, and while configuring application module information by server-side arranges Mode parses the request received, is converted into element needed for calling corresponding interface.
5. HTTP dynamic requests service calling method according to claim 1 or 4, which is characterized in that in the step S5 In, element needed for calling corresponding interface includes service URL and parameter, request method and return type.
6. HTTP dynamic requests service calling method according to claim 5, which is characterized in that in the step S5, The request method is POST request mode or GET request mode.
7. HTTP dynamic requests service calling method according to claim 1, which is characterized in that in the step S6, Server-side calls the mode of corresponding interface are as follows:
Element needed for calling corresponding interface is obtained from the step S5, is assembled into network call format, and execute.
8. HTTP dynamic requests service calling method according to claim 7, which is characterized in that in the step S6, Using HttpClient mode calling interface.
9. HTTP dynamic requests service calling method according to claim 1, which is characterized in that in server-side returned data In the process, if returned data is abnormal, server-side returns to exception information;Otherwise the data for calling server-side to return are returned To front end page.
CN201810804414.8A 2018-07-20 2018-07-20 HTTP dynamic request service calling method Active CN109005163B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810804414.8A CN109005163B (en) 2018-07-20 2018-07-20 HTTP dynamic request service calling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810804414.8A CN109005163B (en) 2018-07-20 2018-07-20 HTTP dynamic request service calling method

Publications (2)

Publication Number Publication Date
CN109005163A true CN109005163A (en) 2018-12-14
CN109005163B CN109005163B (en) 2021-01-26

Family

ID=64597372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810804414.8A Active CN109005163B (en) 2018-07-20 2018-07-20 HTTP dynamic request service calling method

Country Status (1)

Country Link
CN (1) CN109005163B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928709A (en) * 2019-11-21 2020-03-27 中国民航信息网络股份有限公司 Service calling method and device under micro-service framework and server
CN113806037A (en) * 2021-07-14 2021-12-17 远光软件股份有限公司 Service calling method and device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699367A (en) * 2012-09-27 2014-04-02 中国电信股份有限公司 HTTP (hyper text transport protocol) API (application program interface) invoking method and device
CN104363273A (en) * 2014-10-31 2015-02-18 北京思特奇信息技术股份有限公司 Flex server-free external program invoking method and system
KR20180082271A (en) * 2017-01-10 2018-07-18 건국대학교 산학협력단 Cached wadl execution engine and method for calling web services using the theory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699367A (en) * 2012-09-27 2014-04-02 中国电信股份有限公司 HTTP (hyper text transport protocol) API (application program interface) invoking method and device
CN104363273A (en) * 2014-10-31 2015-02-18 北京思特奇信息技术股份有限公司 Flex server-free external program invoking method and system
KR20180082271A (en) * 2017-01-10 2018-07-18 건국대학교 산학협력단 Cached wadl execution engine and method for calling web services using the theory

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928709A (en) * 2019-11-21 2020-03-27 中国民航信息网络股份有限公司 Service calling method and device under micro-service framework and server
CN110928709B (en) * 2019-11-21 2023-08-29 中国民航信息网络股份有限公司 Service calling method and device under micro-service framework and server
CN113806037A (en) * 2021-07-14 2021-12-17 远光软件股份有限公司 Service calling method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN109005163B (en) 2021-01-26

Similar Documents

Publication Publication Date Title
CN112532564B (en) Service calling method and device and electronic equipment
US20160373553A1 (en) Mobile dialogue system and mobile content delivery solutions
CN102147725B (en) Method for supporting dual cameras in Android
CN105701122A (en) Log collection method, apparatus and system
CN105718540A (en) Data loading method and apparatus
CN101808051B (en) Application integration gateway and control method thereof
CN106776826A (en) A kind of update method, the apparatus and system of wrist-watch background picture
JP2017539103A (en) Method, apparatus, server, and system for synchronizing member gain among multiple apparatuses
CN109005163A (en) A kind of HTTP dynamic requests service calling method
CN106101868A (en) Reduced graph generating method and generating means
CN110933075A (en) Service calling method and device, electronic equipment and storage medium
CN106911937B (en) The configuration method and system of present banner background colour in a kind of live streaming
CN109117127A (en) Program code generation method, device and computer readable storage medium
CN109542385B (en) Multi-data-stream on-screen display method, system and device and readable storage medium
CN105847319A (en) Mobile terminal network request method and system
CN107517188A (en) A kind of data processing method and device based on Android system
CN108011877B (en) IP address obtaining method and device based on OSGI, computer equipment and storage medium
CN103152385A (en) Triggering, achieving and executing method of relevant application and relevant equipment
CN110737473A (en) Data processing method and device, terminal and storage medium
CN112732457B (en) Image transmission method, image transmission device, electronic equipment and computer readable medium
CN103647818A (en) Method and system for realizing function setting
CN108170493A (en) A kind of loading method of system module, system and device
CN107977380A (en) Method and apparatus for generating the page
CN107295340A (en) A kind of method and device of remote desktop Video coding
CN113784067A (en) Character superimposing method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 519000 Rooms 806, 901 and 902, No. 29, Lanwan Lane, Tangjiawan Town, Xiangzhou District, Zhuhai City, Guangdong Province

Patentee after: Hongqiao Hi Tech Group Co.,Ltd.

Address before: 519000 1st floor, area D, South Software Park, No.1, Tangjiawan Software Park Road, Zhuhai City, Guangdong Province

Patentee before: ZHUHAI HONGQIAO HIGH-TECH Co.,Ltd.