0

My Api does not accept special character it thoroughgoing error as access-controller allow origin does not accept My File Name is Hello{#$^%.net}.pdf

My Url Format Like This

 http://localhost:5300/api/Insert/DeleteRec/1-1920-9/36/Hello%7B#$^%.net}/pdf 

My Angular Code

fac.DeleteRecFromTemp = function (EnqId, UId, FileName,exten) {
        var fixedstring = decodeURIComponent(escape(FileName));
        return $http({
            url: hostapiUrl + 'Inser/DeleteRec/'+EnqId+"/"+UId+"/" +fixedstring+"/"+exten,
            method: "DELETE",
            headers: { 'content-type': 'application/json' }
        })
    }

Please Help me how can i convert that url into my browser url

1 Answers1

2

Try this one:

url = encodeURI(url)
William Tran
  • 269
  • 1
  • 4