[RestProxy] getting error "Object reference not set to an instance of an object."
restproxy
Web icon
Forge component by Formiga
Application Type
Traditional Web

Hi there, 

I'm hoping this is something dumb I'm doing wrong.  I have your SetProxy Action inside an OnBeforeRequest Action on a REST consuming service.

I've set the ProxyUrl to something like

"https://100.101.102.103:8888"

when I fire a request, I get this error when I try running SetProxy with the url

An error was raised by the application: Object reference not set to an instance of an object.

I haven't set any username or password as I don't need it.

Hi Steve,

Use OnBeforeRequestAdvanced  event instead of OnBeforeRequest  event.

OnBeforeRequest event is used to customize request like changing the URL, Headers etc at runtime

OnBeforeRequestAdvanced   is used to add some customize .net code to request and you are adding a extension a .net extension RESTProxy to add the Proxy in HttpRequest

By seeing the code it seems like the below code is returning null object in OnBeforeRequest as the request is not yet initialized.


Best Regards

Devendra

Hi Devendra, 

Thanks so much for your response.  that's working now.

Steve

Hi Steve,

Kindly markas solved . so if any one will face same issue then they will get that easily

Best Regards

Devendra







Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.