CN111953659B - Method and system for simulating http request - Google Patents
Method and system for simulating http request Download PDFInfo
- Publication number
- CN111953659B CN111953659B CN202010704387.4A CN202010704387A CN111953659B CN 111953659 B CN111953659 B CN 111953659B CN 202010704387 A CN202010704387 A CN 202010704387A CN 111953659 B CN111953659 B CN 111953659B
- Authority
- CN
- China
- Prior art keywords
- url
- simulation
- http
- http request
- request
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/133—Protocols for remote procedure calls [RPC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides a method and a system for http request simulation processing, which comprise the following steps: acquiring url of a local http interface to be called and a corresponding response message; obtaining a simulated url according to the acquired url; correspondingly configuring the simulated url and the obtained response message in an http request configuration table of a server through a foreground http request configuration interface to obtain a simulated request system; the request modeling system is invoked. The beneficial effects of the invention are: the configuration is simple, a mode of first configuration and then calling is adopted, the url of the local http interface is converted to obtain the simulated url, background database configuration is carried out on a foreground interface, a remote end http request simulation system is established, and data calling of a remote research and development end is achieved.
Description
Technical Field
The invention relates to the technical field of databases, in particular to a method and a system for http request simulation processing.
Background
In enterprises with strong security awareness, an intranet system is generally selected for office work, data storage and the like; the enterprise development project is a technical development department and needs remote development due to some conditions, or the enterprise development project outsources the development of other companies.
Under the conditions, the condition that research personnel call a local http interface is limited by the fact that an intranet cannot be connected externally, so that data in an enterprise database cannot be called, research and development work is affected, and research and development projects are difficult to deliver on time. If the method of directly copying data is adopted, the data storage address can be thoroughly changed, and due to the problems of huge project data and authority, only part of data can be copied to carry out research and development work of the part of data, and the data is inconvenient to be quickly integrated with the whole data after the research and development work is finished.
Disclosure of Invention
Aiming at the problems, the invention provides a method and a system for http request simulation processing, which solve the problem that the local http interface is limited in calling during remote research and development.
In order to achieve the above object, the present invention provides a method for http request simulation processing, comprising the steps of:
acquiring url of a local http interface to be called and a corresponding response message;
obtaining a simulated url according to the obtained url;
correspondingly configuring the simulation url and the obtained response message in an http request configuration table of a server through a foreground http request configuration interface to obtain a simulation request system;
the request modeling system is invoked.
As a further improvement of the invention, the url comprises a server address field, a call port field and a path field which are sequentially arranged, and a mock character is added between the call port field and the path field of the url to obtain the simulated url.
As a further improvement of the present invention, the call simulation request system specifically includes:
and sending a simulation url request to a simulation request system, intercepting a path field behind a mock character in the simulation url after the simulation system receives the request, inquiring an http request configuration table according to the path field, obtaining a response message of the simulation url, and outputting the response message.
As a further improvement of the present invention,
the configuration items of the foreground http request configuration interface comprise url addresses and response messages.
As a further improvement of the present invention,
the http request configuration table is stored in a database of the server;
and an http simulation calling history table is also arranged in the database and used for recording calling history.
The invention also provides a system for the http request simulation processing, which comprises an http interface information storage module, a url conversion module, a foreground http request configuration interface, a calling module and a database;
the http interface information storage module is configured to:
storing the obtained url and the response message of the local http interface to be called;
the url conversion module is configured to:
converting the url in the http interface information storage module into an analog url;
the foreground http request configuration interface is configured to:
configuring the simulated url and the obtained response message in an http request configuration table of a database to obtain a simulated request system;
the calling module is configured to:
calling a simulation request system;
the database is configured to:
and storing an http request configuration table configured by the foreground http request configuration interface.
As a further improvement of the invention, the url comprises a server address field, a call port field and a path field which are sequentially arranged, and mock characters are added between the call port field and the path field of the url to obtain the simulated url.
As a further improvement of the present invention, the invoking module is specifically configured to:
and sending a simulation url request to a simulation request system, intercepting a path field behind a mock character in the simulation url after the simulation request system in the database receives the request, inquiring an http request configuration table according to the path field, and obtaining and outputting a response message of the simulation url.
As a further improvement of the present invention,
the configuration items of the foreground http request configuration interface comprise url addresses and response messages.
As a further improvement of the present invention,
and an http simulation calling history table is also arranged in the database and used for recording calling history.
Compared with the prior art, the invention has the following beneficial effects:
the configuration is simple, a mode of first configuration and then calling is adopted, the url of the local http interface is converted to obtain the simulated url, background database configuration is carried out on a foreground interface, a remote end http request simulation system is established, and data calling of a remote research and development end is achieved.
In the process of obtaining the simulated url through url conversion, the original data storage address is not changed, and only mock characters representing simulated identifications are added, so that the data can be quickly restored locally after research and development are completed.
Drawings
Fig. 1 is a flowchart of a method for http request simulation processing according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a system for simulating http request according to an embodiment of the present invention;
FIG. 3 is a configuration page display diagram of a foreground http system according to an embodiment of the present disclosure;
FIG. 4 is a presentation diagram of a foreground http request configuration page disclosed in a real-time embodiment of the present invention;
fig. 5 is a diagram showing a foreground http request query page according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
The invention is described in further detail below with reference to the attached drawing figures:
as shown in fig. 1, the method for simulating http request provided by the present invention includes:
s1, obtaining url and a response message of a local http interface to be called;
s2, obtaining a simulated url according to the obtained url;
and adding mock characters between the calling port field and the path field of the url to obtain the simulated url.
S3, respectively filling the simulation url and the obtained response message in the url address item and the response message item through a foreground http request configuration interface, clicking and storing the simulation url and the obtained response message, and successfully configuring the simulation url and the obtained response message in an http request configuration table in a server database to obtain a simulation request system;
and S4, the caller sends a simulation url request to the simulation request system, the server intercepts a path field behind a mock character in the simulation url, inquires an http request configuration table according to the path field, obtains a response message of the simulation url and outputs the response message.
And S5, simulating a calling history table by http in the database, and recording the calling history by inquiring a page through the http request of the foreground.
As shown in fig. 2, the present invention further provides an http request simulation processing system, which includes an http interface information storage module, a url conversion module, a foreground http request configuration interface, a call module, and a database;
the http interface information storage module is used for:
storing the obtained url and the response message of the local http interface to be called;
a url transformation module to:
the url comprises a server address field, a calling port field and a path field which are sequentially arranged;
and adding mock characters between the calling port field and the path field of the url in the http interface information storage module to obtain the simulated url.
A foreground http request configuration interface configured to:
respectively filling the simulation url and the obtained response message in a url address item and a response message item of an http request page, clicking and storing the simulation url and the obtained response message, and successfully configuring the simulation url and the obtained response message in an http request configuration table of a server database to obtain a simulation request system;
a calling module to:
and the caller sends a simulation url request to the simulation request system, the server intercepts a path field after mock characters in the simulation url, inquires an http request configuration table according to the path field, obtains a response message of the simulation url and outputs the response message.
A database for:
storing an http request configuration table configured by a foreground http request configuration interface;
and an http simulation calling history table is also arranged in the database, and the calling history is recorded through a foreground http request inquiry page.
The embodiment is as follows:
taking a contract of a client company research and development project as an example, a local http interface of the client company needs to be called, the client company uses an internal network for working, research and development personnel of the client company remotely research and develop and call the local http interface to be limited, so that the client company manages url and response messages of basic data, and an http request simulation system is established on a server used for research and development of the client company, so that the research and development personnel of the client company can smoothly call the basic data of the client research and development project, which is concretely as follows:
firstly, adding mock characters between a calling port field and a path field in url of a local http interface to obtain a simulated url;
for example, the original url is:
http://10.161.249.121:10130/esbWS/rest/com_sitech_score_comp_inter_IScoreQueryCoSvc_qryCurScore,
then the new url is:
http://10.161.249.121:10130/mock/esbWS/rest/com_sitech_score_comp_inter_IScoreQueryCoSvc_qryCurScore;
and secondly, configuring a new url (namely a simulated url) and a response message into the server through a foreground http request configuration page.
The process mainly comprises the following steps:
opening a foreground configuration interface, selecting foreground http system configuration, wherein the interface comprises a system name, filling in the name of a server system to be configured, and storing the name; the foreground http system configuration interface is shown in fig. 3.
Selecting a foreground http request configuration page, filling a corresponding position with a new url and a response message, clicking for storage, and successfully configuring the url and the response message into an http request configuration table of a server database; the foreground http request configuration page is shown in fig. 4:
finally, after the configuration is completed, a person in charge of the research and development of the project can send a request for calling a simulation request system to the server at the own office computer and directly send a simulation url, the server receives the path obtained after the simulation url intercepts the mock and matches the path in the http request configuration table of the database, and returns a corresponding response message, so that the research and development basic data of the client company can be directly called at the server. After the call is completed, a call record is left in the simulation call history table.
The foreground configuration interface is further provided with a foreground http request query page, and the foreground http request query page shows the call records of the simulation request system as shown in fig. 5.
The process mainly comprises the following steps: and opening a foreground configuration interface, selecting a foreground http request query page, directly sending a new url of data to be called to a server where a simulation request system is located by a caller in a url address item, intercepting a path after mock in the simulation url by the server, sending the path to an http request configuration table for query, and returning a response message to the caller after matching the path to the url.
The invention has the advantages that:
the http request simulation processing method is suitable for any http request, is strong in compatibility and simple to use, does not affect codes of an original system, and can access a formal http interface only by removing/mock from a simulation url of a simulation system when the simulation url is deployed to a local environment after remote research and development are finished.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (6)
1. A method for simulating http request, comprising the steps of:
acquiring url of a local http interface of an internal network server to be called and a corresponding response message;
obtaining a simulated url according to the acquired url, including: adding mock characters between the calling port field and the path field of the url to obtain a simulated url;
correspondingly configuring the simulated url and the obtained response message in an http request configuration table of the external server by the external server through a foreground http request configuration interface, wherein the simulated url and the obtained response message are respectively filled in a url address item and a response message item to obtain a simulated request system;
the http request configuration table is stored in a database of an external server;
calling a simulation request system in the external server, sending a simulation url request to the simulation request system, intercepting a path field behind a mock character in the simulation url after the simulation request system receives the request, and inquiring the http request configuration table in a database according to the path field to obtain and output a response message of the simulation url;
and an http simulation calling history table is arranged in the database and records calling history.
2. The method of http request emulation processing according to claim 1, wherein:
the url includes a server address field, a call port field, and a path field, which are arranged in sequence.
3. A method of http request emulation processing according to claim 1, wherein:
the configuration items of the foreground http request configuration interface comprise url addresses and response messages.
4. A system for http request emulation processing, comprising: the system comprises an http interface information storage module, a url conversion module, a foreground http request configuration interface, a calling module and a database;
the http interface information storage module is configured to:
storing the obtained url and the response message of the local http interface to be called;
the url conversion module is configured to:
converting the url in the http interface information storage module into an analog url, including: adding mock characters between the calling port field and the path field of the url to obtain a simulated url;
the foreground http request configuration interface is configured to:
configuring the simulated url and the obtained response message in an http request configuration table of a database to obtain a simulated request system;
the calling module is configured to:
calling a simulation request system, sending a simulation url request to the simulation request system, intercepting a path field behind a mock character in the simulation url after the simulation request system in the database receives the request, and inquiring an http request configuration table according to the path field to obtain and output a response message of the simulation url;
the database is configured to:
storing an http request configuration table configured by a foreground http request configuration interface;
and setting an http simulation call history table and recording the call history.
5. The system for http request emulation processing of claim 4, wherein:
the url includes a server address field, a call port field, and a path field, which are arranged in sequence.
6. A system for http request emulation processing according to claim 4, wherein:
the configuration items of the foreground http request configuration interface comprise url addresses and response messages.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010704387.4A CN111953659B (en) | 2020-07-21 | 2020-07-21 | Method and system for simulating http request |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010704387.4A CN111953659B (en) | 2020-07-21 | 2020-07-21 | Method and system for simulating http request |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111953659A CN111953659A (en) | 2020-11-17 |
CN111953659B true CN111953659B (en) | 2023-02-07 |
Family
ID=73340178
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010704387.4A Active CN111953659B (en) | 2020-07-21 | 2020-07-21 | Method and system for simulating http request |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111953659B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112905919B (en) * | 2021-03-15 | 2023-02-10 | 杭州涂鸦信息技术有限公司 | Back-end application calling method and device, computer equipment and readable storage medium |
CN115801652B (en) * | 2022-11-21 | 2024-05-03 | 中国民航信息网络股份有限公司 | Aviation system testing method, system and related device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103856827A (en) * | 2012-11-30 | 2014-06-11 | 中国科学院声学研究所 | Service simulation interaction-based video content obtaining method and system |
CN107257390A (en) * | 2017-05-27 | 2017-10-17 | 北京思特奇信息技术股份有限公司 | A kind of parsing method and system of URL addresses |
CN110727587A (en) * | 2019-09-20 | 2020-01-24 | 平安普惠企业管理有限公司 | Test data acquisition method and device, storage medium and computer equipment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20130078882A (en) * | 2012-01-02 | 2013-07-10 | 주식회사 에프엑스 에듀 | Business model for simulating fx margin transaction through internet homepage |
CN104199725B (en) * | 2014-09-27 | 2017-12-22 | 上海瀚之友信息技术服务有限公司 | A kind of service interface digital simulation method and system |
CN106569951B (en) * | 2016-11-04 | 2019-05-07 | 杭州顺网科技股份有限公司 | A kind of Web test method being detached from the page |
US10089219B1 (en) * | 2017-01-20 | 2018-10-02 | Intuit Inc. | Mock server for testing |
CN110851468A (en) * | 2018-08-01 | 2020-02-28 | 北京京东尚科信息技术有限公司 | Method and device for making simulation response to test request of client |
CN109634605B (en) * | 2018-12-05 | 2021-11-02 | 思必驰科技股份有限公司 | Simulation data generation method and system for web front end |
-
2020
- 2020-07-21 CN CN202010704387.4A patent/CN111953659B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103856827A (en) * | 2012-11-30 | 2014-06-11 | 中国科学院声学研究所 | Service simulation interaction-based video content obtaining method and system |
CN107257390A (en) * | 2017-05-27 | 2017-10-17 | 北京思特奇信息技术股份有限公司 | A kind of parsing method and system of URL addresses |
CN110727587A (en) * | 2019-09-20 | 2020-01-24 | 平安普惠企业管理有限公司 | Test data acquisition method and device, storage medium and computer equipment |
Non-Patent Citations (2)
Title |
---|
"Guigle: A GUI Search Engine for Android Apps";Carlos Bernal-Cárdenas、Kevin Moran;《2019 IEEE/ACM 41st International Conference on Software Engineering: Companion Proceedings (ICSE-Companion)》;20190819;全文 * |
"Web Service测试方法和测试工具的研究";申宁、李桂芝、闫晓艳、徐楠楠;《冶金自动化》;20140902;第608-611页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111953659A (en) | 2020-11-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7467140B2 (en) | System, method, and article of manufacture for maintaining and accessing a whois database | |
US7386575B2 (en) | System and method for synchronizing related data elements in disparate storage systems | |
CN100541492C (en) | Use the data extensibility of external database table | |
CN111953659B (en) | Method and system for simulating http request | |
US7107597B2 (en) | Method of and system for controlling task-oriented systems utilizing an application programming interface | |
US20080005197A1 (en) | Dynamic report mapping apparatus to physical data source when creating report definitions for information technology service management reporting for peruse of report definition transparency and reuse | |
US9251222B2 (en) | Abstracted dynamic report definition generation for use within information technology infrastructure | |
JPH0827765B2 (en) | Object-oriented programming system | |
US6253244B1 (en) | System and computer-implemented method for providing access to host-based screen applications using business-centric software components | |
WO2023231665A1 (en) | Distributed transaction processing method, system and device, and readable storage medium | |
CN109241384B (en) | Scientific research information visualization method and device | |
CA2379930A1 (en) | Multi-model access to data | |
US6199111B1 (en) | Client-led network computing system and its method | |
CN106598931A (en) | Method for generating informative template | |
US9373093B2 (en) | Gateway service manager for business object applications | |
JP2003248635A (en) | Database accessing method and system in management information base of network management protocol | |
CN103645968A (en) | Browser status restoration method and device | |
CN111045928A (en) | Interface data testing method, device, terminal and storage medium | |
CN103107898A (en) | Method, device and system for sending or receiving multiple managed objects simultaneously | |
CN108491448B (en) | Data pushing method and device | |
CN116760913B (en) | Method and system for issuing k8s cluster protocol conversion platform configuration | |
Meyer et al. | The devolution of functional analysis | |
KR20210041781A (en) | An integrated development system for a SyncML serverapplication development | |
CN117389986A (en) | Database compatibility evaluation method and device, electronic equipment and storage medium | |
JP3798580B2 (en) | DATA MANAGEMENT SYSTEM AND COMPUTER-READABLE RECORDING MEDIUM RECORDING PROGRAM FOR EXECUTING THE DATA MANAGEMENT SYSTEM |
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 |