Basic Auth using Post Method for Upstream Service

I am trying to perform basic authentication but using Post Methods where in username and password will be in Body and not header . Need to invoke the upstream services as above.
This upstream services will then send session key and need to use that session key for further APi invoke .
Any help on how to achieve this would be appreciated.