Git Product home page Git Product logo

apim_pyclient's Introduction

This repository contains a Python Client for playing with WSO2 API Manager REST API and a dummy HTTP(s) and WebSocket server for handling/monitoring requests

I wrote this simple python client to make it easy to create , delete , update lifecycle states of an API for testing purposes.

How to get swagger definitions for Store Publisher REST APIS ?

Start WSO2 API Manager server. You can get the swagger definitions for store and publisher REST APIs in following locations.

You need to change the API version , hostname and port accordingly.

Create test artifacts

  • Delete existing APIs
  • Delete existing Endpoints
  • Create new APIs
  • Create new Global endpoints
  • Publish newly created APIs
  • Create new Store Application
  • Delete all existing users (Except admin)
  • Create new users

Echo HTTP(S) server

How to start the simple HTTP server

python3 simple_endpoint.py

Available services with echo server

  • Support Digest Auth
    • Send a request with digestme word in anywhere in the request path
  • Basic Auth header decode
  • CORS request handler
  • Dump payload in POST, PUT or PATCH requests
  • Dump all the headers and return them as JSON in response body
  • Delay (mimic backend latency) response by setting the kdelay (seconds) query parameter in the request i:e http://localhost:8000/apis?kdelay=2.5
  • Response with supported content types (application/xml or application/json). Honor the accept header if present
  • Return sample file when requested with available sample files extensions in mock_servers/resources/ directory
    • Example: localhost:8000/apis/send/me/a.pdf will return python.pdf file in mock_servers/resources/ with content-type header as application/pdf
    • If want to add support to new extension, put the file to mock_servers/resources/ i:e my_sample.extension and make a request like localhost:8000/apis/send/my/sample.extension , It will return the my_sample.extension file with application/{extension} in the content-type header

Websocket Echo server

How to start the simple HTTP endpoint server

python3 simple_websocket.py

What can I do with Simple websocket server

Simple service to monitor WS initialization flow

  • See the initial handshake HTTP request
  • Dump websocket frame content
  • Reply to WS message

apim_pyclient's People

Contributors

tmkasun avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.