Docker push using Remote API - Getting 401 Unauthorized access

I am trying to push an image to a Docker registry . I am able to login to the registry and push Image from the Docker host. Now I am trying to do it remotely using Docker Remote API:

But I am getting error message - request failed 401 Unauthorized.

I am setting X-Registry-Auth on request header and its value - {‘username’: ‘user’, ‘password’: ‘paasswd’, ‘email’: ‘’, ‘serveraddress’ : ‘’}

I am able to login to registry from the Docker host using the same details. Please advise. Thanks in advance. Any input would be great help for me.