One API proxy calling two different target endpoints

前端 未结 2 1902
轻奢々
轻奢々 2021-01-16 07:03

i have just started working with Apigee. I want to create one API proxy which will call two target endpoints based on \'if\' condition. i have created an API and added resou

2条回答
  •  鱼传尺愫
    2021-01-16 07:17

    If you are using the API Proxy Editor UI, then you can do the following:

    (1) Choose New / New Resource from the API Proxy Editor toolbar.

    You will then see this: enter image description here

    (2) For the input field, Optional Target URL, enter the target URL that corresponds to that resource.

    This tool will then generate both a conditional flow for that resource to which you can optionally attach resource-specific policies.

    This tool will also add the needed route rule, and your generated XML will look like this:

    
        
            (proxy.pathsuffix MatchesPath "/someResource") and (request.verb = "GET")
            
                http://myAlternateEndpoint
            
        
        ....
    

提交回复
热议问题