CN110489326A - HTTPAPI adjustment method device, medium and equipment based on IDS - Google Patents

HTTPAPI adjustment method device, medium and equipment based on IDS Download PDF

Info

Publication number
CN110489326A
CN110489326A CN201910617939.5A CN201910617939A CN110489326A CN 110489326 A CN110489326 A CN 110489326A CN 201910617939 A CN201910617939 A CN 201910617939A CN 110489326 A CN110489326 A CN 110489326A
Authority
CN
China
Prior art keywords
ids
data
api
type
file
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
CN201910617939.5A
Other languages
Chinese (zh)
Other versions
CN110489326B (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910617939.5A priority Critical patent/CN110489326B/en
Publication of CN110489326A publication Critical patent/CN110489326A/en
Application granted granted Critical
Publication of CN110489326B publication Critical patent/CN110489326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

Present disclose provides a kind of HTTP API adjustment method, device, medium and electronic equipment based on IDS.The described method includes: reading IDS file obtains IDS file content, wherein the IDS file is the interface specification file for describing API;It parses the IDS file content and obtains corresponding api interface information;Request data and check code are generated according to the api interface information;The request data is sent, and receives the returned data based on the request data;The returned data the type matching whether returned data defines with IDS is detected according to the check code, HTTP API debugging result is determined according to the matching state.The problem of debugging tool that the disclosure proposes automatically generates request data, efficiently reduces the workload of debugging, is capable of the type of automatic Verification returned data, helps developer's discovery and positioning returned data, effectively promotes debugging efficiency.

Description

HTTPAPI adjustment method device, medium and equipment based on IDS
Technical field
This disclosure relates to field of computer technology, in particular to a kind of HTTPAPI adjustment method based on IDS, dress It sets, medium and electronic equipment.
Background technique
When developing a HTTP API, developer usually will constantly be debugged.The adjustment method of most original is in CLI Related tool, such as curl are used in (Command-line Interface, Command Line Interface), send an API request.This Kind mode has many disadvantages: having certain learning cost, needs skillfully to grasp the various parameters of the tool;It is cumbersome, it needs Data are constructed in order line;It is not intuitive, show that the data comparison in composition of return is random in order line.
Also debugging tool can be used to be debugged, Postman is one using relatively widely visualization HTTP API Debugging tool.Developer configures the relevant information of HTTPAPI in visualization interface by some interactive operations, such as URL, Method, Request Headers and Request Body etc..Request is sent by clicking send button.After request returns It can see relevant return information.These information are all shown with comparing intuitive way.Postman gives HTTP API tune Examination provides friendly operation interface and intuitive displaying interface.But developer needs manual configuration API information, this is one The cumbersome work of item.In addition, not doing any verification to returned data, developer needs oneself to judge whether returned data meets It is expected that.It is some not meet expected data and be difficult to be discovered when the data structure of return is more complicated.These give API Debugging bring many inconvenience.
Summary of the invention
The Summary is provided so that with brief form introduction design, these designs will be in specific implementation below Mode part is described in detail.The Summary is not intended to identify the key feature of claimed technical solution or must Feature is wanted, is intended to be used to limit the range of the technical solution of required protection.
The disclosure is designed to provide a kind of HTTPAPI adjustment method, device, medium and electronic equipment based on IDS, It is able to solve at least one technical problem mentioned above.Concrete scheme is as follows:
According to the specific embodiment of the disclosure, in a first aspect, the disclosure provides a kind of HTTPAPI debugging based on IDS Method, comprising:
It reads IDS file and obtains IDS file content, wherein the IDS file is the interface specification text for describing API Part;
It parses the IDS file content and obtains corresponding api interface information;
Request data and check code are generated according to the api interface information;
The request data is sent, and receives the returned data based on the request data;
The returned data the type matching whether returned data defines with IDS is detected according to the check code, according to The matching state determines HTTP API debugging result.
Optionally, the parsing IDS file content obtains corresponding api interface information, comprising:
IDS type is determined according to the IDS file content, and IDS document parser is determined according to the IDS type;
Api interface information is obtained by the IDS document parser, the api interface information includes URL, Method, asks Ask the type of data and the type of returned data.
Optionally, the reading IDS file obtains IDS file content, comprising:
Determine the IDS file type, the IDS file type include opening API specification, Thrift IDL and Protocol Buffers Language;
IDS file content is obtained according to the IDS file type, the IDS file content includes local and remote text Part.
Optionally, the request data includes:
Request data type is consistent with data type defined in the IDS file content;And/or
Request data content is consistent with the semanteme of data name defined in the IDS file content.
Optionally, further includes:
API Debugging message is constituted by the request data, check code, returned data, wherein the API Debugging message Including one of the following contents: the information and data check results that ID, the necessary information for sending HTTP request, HTTP request return.
Optionally, the API Debugging message is showed in display interface by way of label frame, and the label frame includes exhibition Show the label area of API Debugging message label and show the content area of API Debugging message content, is chosen when the label is in When state, the corresponding content of the label is shown in the content area.
Optionally, further includes:
The request data is received in the content area;
Receive the edit operation to the request data;
The request data is shown according to the request data after the edit operation.
Optionally, described that the returned data the class whether returned data defines with IDS is detected according to the check code Type matching, determines HTTP API debugging result according to the matching state, comprising:
It is verified according to type of the check code to the returned data, if data type and the IDS definition returned Data type it is consistent, return API debug success flag;Otherwise, the debugging failed mark of API is returned.
Optionally, it is described otherwise, return the debugging failed mark of API, comprising:
The details of failure are returned simultaneously, and the details of the failure include not meeting expected data, data The actual type of desired type and data.
According to the specific embodiment of the disclosure, the third aspect, the disclosure provides a kind of HTTP API debugging based on IDS Device, comprising:
Uploading module obtains IDS file content for reading IDS file, wherein the IDS file is for describing API Interface specification file;
Parsing module obtains corresponding api interface information for parsing the IDS file content;
Generation module, for generating request data and check code according to the api interface information;
Transceiver module for sending the request data, and receives the returned data based on the request data;
Correction verification module, for detecting the returned data whether returned data defines with IDS according to the check code Type matching determines HTTP API debugging result according to the matching state.
According to the specific embodiment of the disclosure, the third aspect, the disclosure provides a kind of computer readable storage medium, On be stored with computer program, realize when described program is executed by processor such as the described in any item methods of first aspect.
According to the specific embodiment of the disclosure, fourth aspect, the disclosure provides a kind of electronic equipment, comprising: one or Multiple processors;Storage device, for storing one or more programs, when one or more of programs are by one or more When a processor executes, so that one or more of processors realize such as the described in any item methods of first aspect.
The above scheme of the embodiment of the present disclosure compared with prior art, at least has the advantages that
Present disclose provides a kind of HTTP API adjustment method, device, medium and electronic equipment based on IDS.The side Method proposes a kind of HTTP API debugging tool of automation based on IDS file.The debugging tool that the disclosure proposes automatically generates Request data efficiently reduces the workload of debugging.The type for the debugging tool automatic Verification returned data that the disclosure proposes, side The problem of helping developer to find and positioning returned data, effectively promotes debugging efficiency.
Detailed description of the invention
In conjunction with attached drawing and refer to following specific embodiments, the above and other feature, advantage of each embodiment of the disclosure and Aspect will be apparent.In attached drawing, the same or similar appended drawing reference indicates the same or similar element.It should manage Solution attached drawing is schematically that original part and element are not necessarily drawn to scale.In the accompanying drawings:
Fig. 1 shows the flow chart of the HTTP API adjustment method based on IDS according to the embodiment of the present disclosure;
Fig. 2 shows the unit block diagrams according to the HTTP API debugging apparatus based on IDS of the embodiment of the present disclosure;
Fig. 3 shows electronic equipment attachment structure schematic diagram according to an embodiment of the present disclosure.
Specific embodiment
Embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the certain of the disclosure in attached drawing Embodiment, it should be understood that, the disclosure can be realized by various forms, and should not be construed as being limited to this In the embodiment that illustrates, providing these embodiments on the contrary is in order to more thorough and be fully understood by the disclosure.It should be understood that It is that being given for example only property of the accompanying drawings and embodiments effect of the disclosure is not intended to limit the protection scope of the disclosure.
It should be appreciated that each step recorded in disclosed method embodiment can execute in a different order, And/or parallel execution.In addition, method implementation may include additional step and/or omit the step of execution is shown.This public affairs The range opened is not limited in this respect.
Terms used herein " comprising " and its deformation are that opening includes, i.e., " including but not limited to ".Term "based" It is " being based at least partially on ".Term " one embodiment " expression " at least one embodiment ";Term " another embodiment " indicates " at least one other embodiment ";Term " some embodiments " expression " at least some embodiments ".The correlation of other terms is fixed Justice provides in will be described below.
It is noted that the concepts such as " first " that refers in the disclosure, " second " are only used for different devices, module or list Member distinguishes, and is not intended to limit the sequence or relation of interdependence of function performed by these devices, module or unit.
It is noted that referred in the disclosure "one", the modification of " multiple " be schematically and not restrictive this field It will be appreciated by the skilled person that being otherwise construed as " one or more " unless clearly indicate otherwise in context.
The being merely to illustrate property of title of the message or information that are interacted between multiple devices in disclosure embodiment Purpose, and be not used to limit the range of these message or information.
The alternative embodiment of the disclosure is described in detail with reference to the accompanying drawing.
To the first embodiment that the disclosure provides, i.e., the embodiment of a kind of HTTP API adjustment method based on IDS.
Wherein, the API of HTTP (HyperText Transfer Protocol, hypertext transfer protocol) (Application Programming Interface, application programming interface) refers to the API using HTTP transmission data.
Application programming interface (full name in English Application Programming Interface, abbreviation API) is Some functions predetermined, or refer to the agreement of software systems difference component part linking.Purpose is mentioned for software developer For a kind of ability without accessing true form or understanding the details of internal work mechanism and access common software or hardware.Some API Have the function of data input and data output.
The embodiment of the present disclosure is described in detail below with reference to Fig. 1, wherein Fig. 1 is the base that the embodiment of the present disclosure provides In the flow chart of the HTTP API adjustment method of IDS.
According to the specific embodiment of the disclosure, the disclosure provides a kind of HTTP API adjustment method based on IDS, accordingly Method can be deposited by building file uploading module, document analysis module, request data & check code generation module, data Storage & shows that & editor module, data check module and request sending module are carried out, and this method comprises the following steps:
Step S102: it reads IDS file and obtains IDS file content, wherein the IDS file is for describing connecing for API Mouth authority file.
IDS (Interface Description Specification, interface definition standard), which refers to, can completely describe API The specification of information, such as the OAS (OpenAPI Specification, opening API specification) of Swagger, Thrift IDL (Interface Description Language, Interface Definition Language), Protocol Buffers Language and phase Close extension specification etc..
Optionally, the reading IDS file obtains IDS file content, comprising:
Determine the IDS file type, the IDS file type include opening API specification, Thrift IDL and Protocol Buffers Language;IDS file content is obtained according to the IDS file type, the IDS file includes Local and remote file.
Step S104: it parses the IDS file content and obtains corresponding api interface information.
Optionally, the step S104 includes: to determine IDS type according to the IDS file content, according to the IDS class Type determines IDS document parser;By IDS document parser obtain api interface information, the api interface information include URL, The type of Method, the type of request data and returned data.
Step S106: request data and check code are generated according to the api interface information.Optionally, the generation Request data type is consistent with data type defined in the IDS file content;The request data content and IDS text The semanteme of data name defined in part content is consistent.
Request data & check code generation module generates request data according to the type of request data, according to returned data Type generate returned data type checking code.For be located at Request message Body in data, only when " Content-Type " be " application/json ", " application/xml ", " application/x-www-form- Urlencoded ", " multipart/form-data " and " text/plain " Shi Shengcheng request data.The request data of generation Type must be consistent with the type of the request data of definition.For example, when the data type of definition is character string, the number of generation According to being exactly character string, and it cannot be number.The content of the request data of generation has to comply with the semanteme of the title of the data of definition. For example, the data of generation just should comply with mail format when the title of data is " email ".The data of open source can be passed through The data of the generation of the library mock various types and common format.Generation request can be realized on the basis of the data library mock of open source The function of data.The type checking code of generation can verify the data type whether data meet definition.
It optionally, include: that API is constituted by the request data, check code, returned data after the step S106 Debugging message, wherein the API Debugging message includes one of the following contents: ID, the necessary information for sending HTTP request, HTTP are asked Ask the information and data check results of return.
Optionally, the API Debugging message is showed in display interface by way of label frame, and the label frame includes exhibition Show the label area of API Debugging message label and show the content area of API Debugging message content, is chosen when the label is in When state, the corresponding content of the label is shown in the content area.
Optionally, further includes: receive the request data in the content area;Receive the editor to the request data Operation;The request data is shown according to the request data after the edit operation.
Data storage & shows that API Debugging message is being locally stored in & editor module.One API Debugging message includes ID, hair The information and data check results for sending the necessary information of HTTP request, HTTP request to return.ID be an API Debugging message only One identifier;The necessary information for sending HTTP request includes URL, Method, Headers and request data etc.;HTTP request is returned The information returned includes Status Code, Headers and returned data etc.;Data check result refers to the type checking of returned data As a result.A plurality of API Debugging message is shown by the way of Tabs frame.Tabs frame includes a label area and a content regions Domain.Label area shows that the label of multiple API Debugging message, only one label are in selected state.Content area is shown The corresponding API Debugging message of selected label.Support the editor to request data, user that can correct the number automatically generated According to, or addition is not suitable for the data automatically generated, such as picture manually.
Step S108: the request data is sent, and receives the returned data based on the request data;
The transmitting-receiving of above-mentioned data can be realized by request sending module, request sending module, which is realized, sends HTTP request Function.If realizing this debugging tool with webpage, request sending module can solve in such a way that server-side forwards request Cross-domain problem.Request sending module shows & editor module acquisition request information from data storage & first;Then HTTP is called to ask API is asked to send request, such as XMLHttpRequest;The information that request returns finally is transmitted to data storage & and shows that & edits mould Block is shown, while the data of return are transmitted to data check module and are verified.
Step S110: detecting whether the returned data matches with the data type that IDS is defined according to the check code, According to the matching state it is determining HTTP API debugging result.
Data check module can be constructed to verify returned data, data check module is verified using request data & The check code that code generation module generates verifies the type for the data that request returns.If return data type and The data type of definition is consistent, is returned to success.Otherwise, failure is returned, while returning to the details of failure.What is failed is detailed Information includes not meeting the actual type of expected data, the desired type of data and data.
Optionally, the step S110 includes: and is verified according to type of the check code to the returned data, if The data type of return and the data type of definition are consistent, return to API and debug success flag;Otherwise, the debugging failed mark of API is returned Know.
Optionally, it is described otherwise, it is debugging failed to return to API, comprising: while returning to the details of failure, the failure Details include not meeting the actual type of expected data, the desired type of data and data.
The method proposes a kind of HTTP API debugging tool of automation based on IDS file.The operation of this debugging tool Process are as follows: file uploading module reads IDS file and obtains IDS file content;Document analysis module parsing IDS file content obtains API information;Request data & check code generation module generates request data and check code according to API information, is transmitted to number respectively & editor module and correction verification module are shown according to storage &;Data storage & shows that request data is kept in and shown to & editor module, simultaneously Editting function is provided;Request module sends request data and receives returned data, and returned data is then transmitted to data storage & exhibition Show & editor module and correction verification module;Correction verification module calls the legitimacy of check code detection returned data, and check results are transmitted to Data storage & shows that & editor module is shown.The debugging tool that the disclosure proposes automatically generates request data, effectively subtracts The workload debugged less.The type for the debugging tool automatic Verification returned data that the disclosure proposes helps developer's discovery and determines The problem of position returned data, effectively promote debugging efficiency.
Corresponding with the first embodiment that the disclosure provides, the disclosure additionally provides second embodiment, i.e., a kind of to be based on IDS HTTP API debugging apparatus.Since second embodiment is substantially similar to first embodiment, so describe fairly simple, it is related Part refer to the corresponding explanation of first embodiment.Installation practice described below is only schematical.
Fig. 2 shows a kind of embodiments for HTTP API debugging apparatus based on IDS that the disclosure provides.Fig. 2 is this public affairs The unit block diagram of the HTTP API debugging apparatus based on IDS of embodiment offer is provided.
Shown in Figure 2, the disclosure provides a kind of HTTP API debugging apparatus based on IDS, comprising: upper secondary module 202, parsing module 204, generation module 206, transceiver module 208 and correction verification module 210.
Upper secondary module 202: IDS file content is obtained for reading IDS file, wherein the IDS file is for describing The interface specification file of API.
Optionally, the upper secondary module 202 is also used to:
Determine that the IDS file type, the IDS file type include opening API specification, Thrift IDL Class specification And Protocol Buffers Class specification;IDS file content is obtained according to the IDS file type, in the IDS file Holding includes local and remote file.
Parsing module 204: corresponding api interface information is obtained for parsing the IDS file content.
Optionally, the parsing module 204 is also used to: IDS type is determined according to the IDS file content, according to IDS class Type determines resolver;By IDS document parser obtain api interface information, the api interface information include URL, Method, The type of request data and the type of returned data.
Generation module 206: request data and check code are generated according to the api interface information.Optionally, the generation Request data type it is consistent with data type defined in the IDS file content;The request data content and the IDS The semanteme of data name defined in file content is consistent.
Optionally, the generation module 206 is also used to: being made up of the request data, check code, returned data API Debugging message, wherein the API Debugging message includes one of the following contents: ID, send HTTP request necessary information, The information and data check results that HTTP request returns.
Optionally, the API Debugging message is showed in display interface by way of label frame, and the label frame includes exhibition Show the label area of API Debugging message label and show the content area of API Debugging message content, is chosen when the label is in When state, the corresponding content of the label is shown in the content area.
Optionally, further includes: receive the request data in the content area;Receive the editor to the request data Operation;Request data is shown according to the request data after the edit operation.
Transceiver module 208: for sending the request data, and the returned data based on the request data is received.
Correction verification module 210: for detecting the number whether returned data defines with the IDS according to the check code According to matching, according to the matching state it is determining HTTPAPI debugging result.
Optionally, the correction verification module 210 is used for: it is verified according to type of the check code to the returned data, If the data type returned is consistent with the data type of definition, returns to API and debug success flag;Otherwise, API debugging is returned to lose Lose mark.
Optionally, it is described otherwise, it is debugging failed to return to API, comprising: while returning to the details of failure, the failure Details include not meeting the actual type of expected data, the desired type of data and data.
Described device provides a kind of HTTP API debugging tool of automation based on IDS file.The operation of this debugging tool Process are as follows: file uploading module reads IDS file and obtains IDS file content;Document analysis module parsing IDS file content obtains API information;Request data & check code generation module generates request data and check code according to API information, is transmitted to number respectively & editor module and correction verification module are shown according to storage &;Data storage & shows that request data is kept in and shown to & editor module, simultaneously Editting function is provided;Request module sends request data and receives returned data, and returned data is then transmitted to data storage & exhibition Show & editor module and correction verification module;Correction verification module calls the legitimacy of check code detection returned data, and check results are transmitted to Data storage & shows that & editor module is shown.The debugging tool that the disclosure proposes automatically generates request data, effectively subtracts The workload debugged less.The type for the debugging tool automatic Verification returned data that the disclosure proposes helps developer's discovery and determines The problem of position returned data, effectively promote debugging efficiency.
The embodiment of the present disclosure provides 3rd embodiment, i.e. a kind of electronic equipment, which is used for the HTTP based on IDS API adjustment method, the electronic equipment, comprising: at least one processor;And connect at least one described processor communication The memory connect;Wherein,
The memory is stored with the instruction that can be executed by one processor, and described instruction is by described at least one It manages device to execute, so that at least one described processor is able to carry out the HTTP API debugging based on IDS as in the first embodiment Method.
The embodiment of the present disclosure provides fourth embodiment, i.e., a kind of HTTP API debugging computer based on IDS, which stores, to be situated between Matter, the computer storage medium are stored with computer executable instructions, and the computer executable instructions are executable as first is real Apply the HTTP API adjustment method described in example based on IDS.
Below with reference to Fig. 3, it illustrates the structural schematic diagrams for the electronic equipment for being suitable for being used to realize the embodiment of the present disclosure.This Terminal device in open embodiment can include but is not limited to such as mobile phone, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable media player), car-mounted terminal (such as vehicle mounted guidance Terminal) etc. mobile terminal and such as number TV, desktop computer etc. fixed terminal.Electronic equipment shown in Fig. 3 An only example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in figure 3, electronic equipment may include processing unit (such as central processing unit, graphics processor etc.) 301, Random access storage device can be loaded into according to the program being stored in read-only memory (ROM) 302 or from storage device 308 (RAM) program in 303 and execute various movements appropriate and processing.In RAM 303, it is also stored with electronic device institute The various programs and data needed.Processing unit 301, ROM 302 and RAM 303 are connected with each other by bus 304.Input/defeated (I/O) interface 305 is also connected to bus 304 out.
In general, following device can connect to I/O interface 305: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 306 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 307 of dynamic device etc.;Storage device 308 including such as tape, hard disk etc.;And communication device 309.Communication device 309, which can permit electronic equipment, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 3, which is shown, to be had respectively The electronic equipment of kind device, it should be understood that being not required for implementing or having all devices shown.It can be alternatively real Apply or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising being carried on non-transient computer can The computer program on medium is read, which includes the program code for method shown in execution flow chart.At this In the embodiment of sample, which can be downloaded and installed from network by communication device 309, or be filled from storage It sets 308 to be mounted, or is mounted from ROM 302.When the computer program is executed by processing unit 301, the disclosure is executed The above-mentioned function of being limited in the method for embodiment.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In open, computer-readable signal media may include in a base band or as the data-signal that carrier wave a part is propagated, In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit Any computer-readable medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned Any appropriate combination.
In some embodiments, client, server can use such as HTTP (HyperText Transfer Protocol, hypertext transfer protocol) etc the network protocols of any currently known or following research and development communicated, and can To be interconnected with the digital data communications (for example, communication network) of arbitrary form or medium.The example of communication network includes local area network (" LAN "), wide area network (" WAN "), Internet (for example, internet) and ad-hoc network are (for example, the end-to-end net of ad hoc Network) and any currently known or following research and development network.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity When sub- equipment executes, so that the electronic equipment: obtaining at least two internet protocol addresses;Send to Node evaluation equipment includes institute State the Node evaluation request of at least two internet protocol addresses, wherein the Node evaluation equipment is internet from described at least two In protocol address, chooses internet protocol address and return;Receive the internet protocol address that the Node evaluation equipment returns;Its In, the fringe node in acquired internet protocol address instruction content distributing network.
Alternatively, above-mentioned computer-readable medium carries one or more program, when said one or multiple programs When being executed by the electronic equipment, so that the electronic equipment: receiving the Node evaluation including at least two internet protocol addresses and request; From at least two internet protocol address, internet protocol address is chosen;Return to the internet protocol address selected;Wherein, The fringe node in internet protocol address instruction content distributing network received.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include but is not limited to object oriented program language-such as Java, Smalltalk, C++ further include conventional procedural programming language-such as " C " language or similar programming language. Program code can be executed fully on the user computer, partly execute on the user computer, be independent as one Software package executes, part executes on the remote computer or completely in remote computer or clothes on the user computer for part It is executed on business device.In situations involving remote computers, remote computer can pass through the network of any kind --- including Local area network (LAN) or wide area network (WAN)-are connected to subscriber computer, or, it may be connected to outer computer (such as using ISP is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, the One acquiring unit is also described as " obtaining the unit of at least two internet protocol addresses ".
Function described herein can be executed at least partly by one or more hardware logic components.Example Such as, without limitation, the hardware logic component for the exemplary type that can be used include: field programmable gate array (FPGA), specially With integrated circuit (ASIC), Application Specific Standard Product (ASSP), system on chip (SOC), complex programmable logic equipment (CPLD) etc. Deng.
In the context of the disclosure, machine readable media can be tangible medium, may include or is stored for The program that instruction execution system, device or equipment are used or is used in combination with instruction execution system, device or equipment.Machine can Reading medium can be machine-readable signal medium or machine-readable storage medium.Machine readable media can include but is not limited to electricity Son, magnetic, optical, electromagnetism, infrared or semiconductor system, device or equipment or above content any conjunction Suitable combination.The more specific example of machine readable storage medium will include the electrical connection of line based on one or more, portable meter Calculation machine disk, hard disk, random access memory (RAM), read-only memory (ROM), Erasable Programmable Read Only Memory EPROM (EPROM Or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage facilities or Any appropriate combination of above content.
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that the open scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from design disclosed above, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure Can technical characteristic replaced mutually and the technical solution that is formed.
Although this is not construed as requiring these operations with institute in addition, depicting each operation using certain order The certain order that shows executes in sequential order to execute.Under certain environment, multitask and parallel processing may be advantageous 's.Similarly, although containing several specific implementation details in being discussed above, these are not construed as to this public affairs The limitation for the range opened.Certain features described in the context of individual embodiment can also be realized in combination single real It applies in example.On the contrary, the various features described in the context of single embodiment can also be individually or with any suitable The mode of sub-portfolio is realized in various embodiments.
Although having used specific to this theme of the language description of structure feature and/or method logical action, answer When understanding that theme defined in the appended claims is not necessarily limited to special characteristic described above or movement.On on the contrary, Special characteristic described in face and movement are only to realize the exemplary forms of claims.

Claims (12)

1. a kind of HTTP API adjustment method based on IDS characterized by comprising
It reads IDS file and obtains IDS file content, wherein the IDS file is the interface specification file for describing API;
It parses the IDS file content and obtains corresponding api interface information;
Request data and check code are generated according to the api interface information;
The request data is sent, and receives the returned data based on the request data;
The returned data the type matching whether returned data defines with IDS is detected according to the check code, according to described Matching state determines HTTP API debugging result.
2. the method according to claim 1, wherein the parsing IDS file content obtains corresponding API Interface message, comprising:
IDS type is determined according to the IDS file content, and IDS document parser is determined according to the IDS type;
Api interface information is obtained by the IDS document parser, the api interface information includes URL, Method, number of request According to type and returned data type.
3. the method according to claim 1, wherein the reading IDS file obtains IDS file content, comprising:
Determine that the IDS file type, the IDS file type include opening API specification, Thrift IDL and Protocol Buffers Language;
IDS file content is obtained according to the IDS file type, the IDS file includes local and remote file.
4. the method according to claim 1, wherein the generation request data includes:
The request data type generated is consistent with data type defined in the IDS file content;And/or
The request data content generated is consistent with the semanteme of data name defined in the IDS file content.
5. the method according to claim 1, wherein further include:
API Debugging message is constituted by the request data, check code, returned data, wherein the API Debugging message includes One of the following contents: the information and data check results that ID, the necessary information for sending HTTP request, HTTP request return.
6. according to the method described in claim 5, it is characterized in that, the API Debugging message is shown by way of label frame In display interface, the label frame includes the label area and displaying API Debugging message content for showing API Debugging message label Content area, when the label is in selected state, the corresponding content of the label is shown in the content area.
7. according to the method described in claim 6, it is characterized by further comprising:
The request data is received in the content area;
Receive the edit operation to the request data;
The request data is shown according to the request data after the edit operation.
8. the method according to claim 1, wherein described detect the returned data according to the check code The returned data type matching whether defined with IDS determines HTTP API debugging result according to the matching state, comprising:
It is verified according to type of the check code to the returned data, if the number that the data type and IDS that return define It is consistent according to type, it returns to API and debugs success flag;Otherwise, the debugging failed mark of API is returned.
9. according to the method described in claim 8, it is characterized in that, it is described otherwise, return the debugging failed mark of API, comprising:
The details of failure are returned simultaneously, and the details of the failure include not meeting the expection of expected data, data The actual type of type and data.
10. a kind of HTTP API debugging apparatus based on IDS characterized by comprising
Uploading module obtains IDS file content for reading IDS file, wherein the IDS file is for describing connecing for API Mouth authority file;
Parsing module obtains corresponding api interface information for parsing the IDS file content;
Generation module, for generating request data and check code according to the api interface information;
Transceiver module for sending the request data, and receives the returned data based on the request data;
Correction verification module, for detecting the returned data the type whether returned data defines with IDS according to the check code Matching, determines HTTP API debugging result according to the matching state.
11. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is processed Device realizes method as claimed in any one of claims 1-9 wherein when executing.
12. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs, when one or more of programs are by one or more of processing When device executes, so that one or more of processors realize method as claimed in any one of claims 1-9 wherein.
CN201910617939.5A 2019-07-09 2019-07-09 IDS-based HTTPAPI debugging method device, medium and equipment Active CN110489326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910617939.5A CN110489326B (en) 2019-07-09 2019-07-09 IDS-based HTTPAPI debugging method device, medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910617939.5A CN110489326B (en) 2019-07-09 2019-07-09 IDS-based HTTPAPI debugging method device, medium and equipment

Publications (2)

Publication Number Publication Date
CN110489326A true CN110489326A (en) 2019-11-22
CN110489326B CN110489326B (en) 2023-08-25

Family

ID=68546953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910617939.5A Active CN110489326B (en) 2019-07-09 2019-07-09 IDS-based HTTPAPI debugging method device, medium and equipment

Country Status (1)

Country Link
CN (1) CN110489326B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399825A (en) * 2020-03-17 2020-07-10 四川研宝科技有限公司 API (application programming interface) development management method and system based on API document
CN112612452A (en) * 2020-12-18 2021-04-06 华人运通(上海)云计算科技有限公司 API platform implementation method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160164953A1 (en) * 2014-12-05 2016-06-09 Vmware, Inc. Runtime generation of application programming interfaces for remote procedure call services
CN107562464A (en) * 2017-09-13 2018-01-09 郑州云海信息技术有限公司 A kind of call method of command line interface, device and equipment
CN108429738A (en) * 2018-02-11 2018-08-21 中车青岛四方机车车辆股份有限公司 A kind of data analysis method and analyzing platform
CN108959076A (en) * 2018-06-25 2018-12-07 浙江网新恒天软件有限公司 A kind of API on-line debugging method
CN109165017A (en) * 2018-07-05 2019-01-08 平安科技(深圳)有限公司 Data verification method, device and computer storage medium
CN109947646A (en) * 2019-03-13 2019-06-28 平安信托有限责任公司 Interface test method, device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160164953A1 (en) * 2014-12-05 2016-06-09 Vmware, Inc. Runtime generation of application programming interfaces for remote procedure call services
CN107562464A (en) * 2017-09-13 2018-01-09 郑州云海信息技术有限公司 A kind of call method of command line interface, device and equipment
CN108429738A (en) * 2018-02-11 2018-08-21 中车青岛四方机车车辆股份有限公司 A kind of data analysis method and analyzing platform
CN108959076A (en) * 2018-06-25 2018-12-07 浙江网新恒天软件有限公司 A kind of API on-line debugging method
CN109165017A (en) * 2018-07-05 2019-01-08 平安科技(深圳)有限公司 Data verification method, device and computer storage medium
CN109947646A (en) * 2019-03-13 2019-06-28 平安信托有限责任公司 Interface test method, device, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111399825A (en) * 2020-03-17 2020-07-10 四川研宝科技有限公司 API (application programming interface) development management method and system based on API document
CN112612452A (en) * 2020-12-18 2021-04-06 华人运通(上海)云计算科技有限公司 API platform implementation method, device, equipment and storage medium
CN112612452B (en) * 2020-12-18 2023-11-14 华人运通(上海)云计算科技有限公司 API platform realization method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110489326B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
CN109062563B (en) Method and device for generating page
CN109992732A (en) Information sharing method, device, electronic equipment and storage medium
CN110119294A (en) The generation method of menu page, apparatus and system
US11586772B2 (en) Method and device for displaying information
CN108574604A (en) test method and device
CN108494860A (en) WEB accesses system, WEB access methods and device for client
CN110489323A (en) Visual RPC API adjustment method, device, medium and equipment
CN108958992A (en) test method and device
CN107295607A (en) Method and apparatus for connecting WAP
CN110209315A (en) The display methods of character, device, electronic equipment and storage medium in user interface
CN110245030A (en) A kind of data service providing method, device, medium and electronic equipment
CN110362488A (en) A kind of page test method, device, electronic equipment and storage medium
CN110135168A (en) Detection method, device, system, terminal device and the storage medium of application program
CN110489326A (en) HTTPAPI adjustment method device, medium and equipment based on IDS
US8832252B2 (en) Extensible integration between service platforms
CN110377273A (en) A kind of method, apparatus of data processing, medium and electronic equipment
CN110275736A (en) Obtain operation data method, apparatus, equipment and the readable medium of application program
CN109656799A (en) Test method and device
CN109218041A (en) Request processing method and device for server system
CN109814915A (en) Method for parameter configuration, device, medium and electronic equipment based on lua
CN110389899A (en) Detect square law device, medium and the equipment of the API data type of JS program
CN109947423A (en) Code generating method, device, terminal and medium
CN111813685A (en) Automatic testing method and device
CN109981546A (en) The method and apparatus for obtaining the far call relationship between application module
CN109614603A (en) Method and apparatus for generating information

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