save to file first and use file to submit to server