[ardoHTTP] [ardoHTTP] - Invalid URI: The format of the URI could not be determined.

Forge Component
Published on 2018-10-30 by Ricardo Silva
17 votes
Published on 2018-10-30 by Ricardo Silva

Hello Ricardo

I am trying to use HTTPGet action from this component in order to validate a URL.

My use case is the following:

1) I have a form with several fields, one of those fields is a URL

2)  When I press Save on that form, I only want the changes to be saved if the URL is valid

3) To do so, I encapsulated the HTTPGet action in an action of my own that returns a Success (boolean, True if HTTPGet.Status = "OK", false otherwise) and a Message, bound to the HTTPGet.Response field

4) I'm passing the value the User types in the form's URL input format to this action

5) If the HTTPGet action returns valid, the action's flow continues to save the changes to the database, otherwise, it should throw a message telling the user the URL is not valid and thus not commiting any changes to the Database

The problem is I get an Exception when the debugger reaches the HTTGet action with the message 'Invalid URI: The format of the URI could not be determined.' even though I'm testing with a pretty standard URL (www.google.com). Am I doing something wrong?

I'm using version 1.2.0 since I'm using Service Studio version 10.0.904.0

Best regards

Might be a silly question, but does your URL have the http:// / https:// at the beginning?

Hello Ricardo, thank you for replying so quickly

I was not typing the http:// bit, and now that I am, it works. The problem is, I wanted to use this component in order to validate if the typed URL was a valid one. This means that if the user types http://www.google.com, the action should return Success = true, but if the user types something like http://addrfweqrweqr, it should return Success = false, which isn't the case, but maybe this is not what this action is supposed to do

Best regards,

Ângelo Sousa