how to access sharepoint using api requests with headers having user credentials. For example getting list of all the documents that are there in sharepoint. Is there a way where we can send http request along with user credentials and get response from sharepoint, If not please specify a method to achieve this.i am developing this application in golang
There is no direct way of doing this. Since you have on-prem environment, you can try following link.