How to handle non-200 status codes from hosted targets?

Hi,


I have a Node.js running on a hosted target. Everythig's fine when I send back a 200 from Node. When it is a 400 or a 500 error, it skips the response flow policies. For regular HTTP targets, we have the below property (success.codes):

<HTTPTargetConnection>
        <SSLInfo>
            <Enabled>true</Enabled>
            <ClientAuthEnabled>false</ClientAuthEnabled>
        </SSLInfo>
        <URL>https://***:***</URL>
        <Properties>
            <Property name="success.codes">2XX, 4XX, 5XX</Property>
        </Properties>
    </HTTPTargetConnection>
</TargetEndpoint>

Do we have similar setting for hosted targets, to force the proxy through the regular flow, rather than the fault flow?

Thanks,

Girish

Solved Solved
0 3 1,219
1 ACCEPTED SOLUTION

It should work just like any other HTTP endpoint. Can you share the configuration for the setup you expect to work, but it doesn't?

View solution in original post

3 REPLIES 3

It should work just like any other HTTP endpoint. Can you share the configuration for the setup you expect to work, but it doesn't?

Thanks @Jeremy Whitlock,

I was referring to the Scripted Target/Hosted Target config. However, was able to resolve my making the change as below (added Property success.codes for 2XX, 3XX, 4XX, 5XX):

...
 <HostedTarget>
        <Properties>
            <Property name="success.codes">2xx, 3xx, 4xx, 5xx</Property>
        </Properties>
    </HostedTarget>
</TargetEndpoint>

Thanks Again,

Girish


Glad you got it working. Hosted Targets are no different than any other HTTP target, although different than the ScriptTarget.