Secara default, host dan port (traffic) ditetapkan secara default ke 0
dan 8998.
Anda menentukan port saat menginstal Apigee Emulator, serta nilai resource dan basepath saat mengembangkan proxy API.
Menggunakan curl untuk menguji API
Untuk menguji API menggunakan curl, buka tab Terminal dan jalankan panggilan ke API Anda.
Contoh:
curl 0:8998/helloworld
Mengautentikasi menggunakan kunci API
Jika API Anda memerlukan autentikasi berbasis kunci API:
Build dan ekspor resource pengujian aplikasi developer, developer, dan produk API, seperti yang dijelaskan dalam Mem-build resource pengujian
Klik Active developer apps di bagian Active test resources di Apigee Emulator dan salin nilai consumerKey (tanpa tanda kutip) untuk produk API, seperti yang ditunjukkan dalam gambar berikut.
Teruskan kunci API dalam panggilan curl, seperti yang diwajibkan oleh API Anda. Misalnya, panggilan curl berikut meneruskan kunci API dalam parameter kueri apikey:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-04-03 UTC."],[[["This page provides guidance on testing APIs within both Apigee and Apigee hybrid environments."],["The 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."],["You can test APIs using curl by opening the \"Terminal\" tab and executing a call to your API endpoint, with examples provided."],["API key-based authentication can be implemented by building and exporting relevant test resources, such as API products, developers, and developer apps, and passing the `consumerKey` value in the curl request."],["Before 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."]]],[]]