use Magento\Quote\Model\Quote\Address\RateRequest;
$destCountryId = $request->getDestCountryId();
$destState = $request->getDestRegionCode();
$destCity = $request->getDestCity();
use this code I can get the address in my custom shipping method. but if people select address no entered into input,sometime I can't get RegionCode,getDestRegionCode() return null.
After observation, I found if State/Province is entered into input not select from Magento after checkout the address will be saved.Next time to select this address in Shipping Address page, getDestRegionCode() return null.
What's wrong with my code? How to get State/Province reliably?
In this way getDestRegionCode() return null not 'zhejiang '
In this way entered zhejiagn getDestRegionCode() can get right value 'zhejiang'