ServiceNow Import Set API POST

Does anyone have experience using Invoke-RESTMethod to POST to the ServiceNow Import Set API? I tried to do it the same as connecting directly to the tables (code below), and I end up with a ‘Too many automatic redirections were attempted.’ error. I saw a few articles referencing that you need to store cookies but I am not sure how to do this.

$POSTuri = ''

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add('Authorization',('Basic YJH%#IOJ#GGdfgdsfXBpX2Jn3jhkl390f329213nkjfasfpX2l0YWM6QVNET01XMjasdfas33$#%^45M2Mz$K%#%'))

# Specify request body
$body = @{
    'assigned_to' = 'Edmond Yee'
    'work_notes' = 'Assigning ticket to me. Test 10/4/16 11:20am'
    'number' = "$item"
}#end body
$json = $body | ConvertTo-Json
Invoke-WebRequest -Method Post -Headers $headers -Uri $POSTuri -Body $json

You know you could just email me:D