Hello i'm trying to use the Web API for rF2.
The one you find here after launching rF2 : http://localhost:5397/swagger/index.html
I'm using the ai/add call to try and add an AI from a powershell.
Here is the API working well with "Try it out" :
And here is a powershell script that should do the same, but don't work (Not the right car added) :
Anyone know how this API should be scripted in Powershell and can help me ?
Thanks.
The one you find here after launching rF2 : http://localhost:5397/swagger/index.html
I'm using the ai/add call to try and add an AI from a powershell.
Here is the API working well with "Try it out" :
And here is a powershell script that should do the same, but don't work (Not the right car added) :
Code:
$url = "http://localhost:5397/rest/sessions/ai/add"
$body = @{
"String" = "BMW M8 GTE #22"
}
Invoke-RestMethod -Method 'Post' -Uri $url -Body ($body|ConvertTo-Json) -ContentType "application/json"
Anyone know how this API should be scripted in Powershell and can help me ?
Thanks.