Solved

Test-a-rest with a command - URI is malformed

  • 7 February 2023
  • 2 replies
  • 300 views

Userlevel 7
Badge +24

Hi,

I’m working with Test-a-rest 

I’m getting an issue when trying to run status change actions.  For example I have this simplified script:

 

```cs

Eval "S"  Into myRegionCode 
Get SalesRegionsHandling.svc/SalesRegions(RegionCode='{$myRegionCode}') Into myRegion
Print myRegion
Create SalesRegionsHandling.svc/SalesRegions(RegionCode='{$myRegionCode}')/IfsApp.SalesRegionsHandling.SalesRegion_SetHidden Using myRegion
{
}

```

 

It should set the Region from Active to Hidden.

But I get this error, URI is malformed.  Any ideas what’s going wrong?

 

icon

Best answer by HET 8 February 2023, 12:48

View original

2 replies

Badge

Hi!

You cannot do a Create command with “using” parameter. You can see in the error message from the server that “using...” is sent in the HTTP request. Which the server does not accept (and gives error)

If the server requires e-tag in the header use “Patch” or similar command. Check the command reference documentation, it’s quite elaborated in the syntax and inner workings.

Userlevel 7
Badge +24

Thanks @HET !

I found how to do it.  keyword “Action”

 

Eval "T"  Into myRegionCode 

Get SalesRegionsHandling.svc/SalesRegions(RegionCode='{$myRegionCode}') Into myRegion

Action SalesRegionsHandling.svc/SalesRegions(RegionCode='{$myRegionCode}')/IfsApp.SalesRegionsHandling.SalesRegion_SetHidden Using myRegion  Into result
{
}

 

Reply