Standardmäßig sind Host und Port (Traffic) standardmäßig 0 bzw. 8998.
Sie definieren den Port bei der Installation des Apigee Emulators und Sie definieren Basispfad- und Ressourcenwerten, wenn Sie Ihren API-Proxy entwickeln.
APIs mit curl testen
Um Ihre APIs mit curl zu testen, öffnen Sie den Tab Terminal und führen Sie einen Aufruf Ihrer API aus.
Beispiel:
curl 0:8998/helloworld
Authentifizierung mit einem API-Schlüssel
Wenn die API eine API-Schlüssel-Authentifizierung erfordert:
API-Produkt, Entwickler und Entwicklerressourcen der App-Entwickler erstellen und exportieren, wie unter Testressourcen erstellen beschrieben
Klicken Sie im Abschnitt Aktive Testressourcen des Apigee Emulators auf geladene Entwickler-Apps und kopieren Sie den Wert consumerKey (ohne Anführungszeichen) für das API-Produkt, wie in der folgenden Abbildung dargestellt.
Übergeben Sie den API-Schlüssel im curl-Aufruf gemäß der API. Mit dem folgenden curl-Aufruf wird beispielsweise der API-Schlüssel im Abfrageparameter apikey übergeben:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-18 (UTC)."],[[["\u003cp\u003eThis page provides guidance on testing APIs within both Apigee and Apigee hybrid environments.\u003c/p\u003e\n"],["\u003cp\u003eThe URL for an API proxy endpoint is found within the "emulators" section under "Active deployments" and typically consists of a host and port, basepath, and resource.\u003c/p\u003e\n"],["\u003cp\u003eYou can test APIs using curl by opening the "Terminal" tab and executing a call to your API endpoint, with examples provided.\u003c/p\u003e\n"],["\u003cp\u003eAPI key-based authentication can be implemented by building and exporting relevant test resources, such as API products, developers, and developer apps, and passing the \u003ccode\u003econsumerKey\u003c/code\u003e value in the curl request.\u003c/p\u003e\n"],["\u003cp\u003eBefore testing an API, it may be necessary to create and export a test set of resources, mirroring a production environment, such as API products, developers, and apps.\u003c/p\u003e\n"]]],[],null,[]]