You don't.
Those are necessary portions of the URL to tell the browser what protocol to use (HTTPs, FTP, Gopher), the domain go to (localhost), as well as what port number (00000) to use
Once it gets to localhost:0000, then it is your web applications reponsibility to handle the request for "/api/Details?Id=1"
Once you publish the website, whatever domain name you are using will replace the
localhost portion of the URL and as long as you go to the standard port for the protocol (http:80 / 443: https) then the port information (
0000) will not be in the URL.
Reference:
What is a URL? - Learn web development | MDN[
^]