added test code to use curl.