Java how to get X-Frappe-CSRF-Token or in API rest calls

Java how to get X-Frappe-CSRF-Token or in API rest calls

I need frappe API rest access for post PaymentEntry
and how to get csrf token