摘要 |
A method and an apparatus for invoking an application programming interface (APl) are disclosed. The method includes: loading a prestored JS file to a webpage after loading of the webpage is completed; receiving an invoking request that is sent by the webpage by invoking the JS file; and invoking a corresponding AP1 according to a JS URL. This solves a problem that an encoded URL in each webpage needs to be modified when an encoding rule of a URL in a specified format is changed, which is complicated in operation, wastes time, and is poor in compatibility with clients in different versions. |