在使用nmhttp控件的post 、get方法发送数据时,
请问我应该怎么用分别使用这两种方法发送数据,
对方在cgi中有如何接受发送过来的参数数据。
请各位高手指教、最好有着两种方法的详细说明和使用范例。
在下先谢谢了。

解决方案 »

  1.   

    delphi帮助里面如是说:TNMHTTPDeclaration
    procedure Get(URL: string); virtual;Description
    The Get method retrieves the document specified by the URL parameter. If InputFileMode is TRUE, the document retrieved by the Get method is stored in the file that is specified by the Body property, and the header is stored in the file that is specified by the Header property.If InputFileMode is FALSE, the document retrieved by the Get method is stored in the Body property as a string. The header is stored in the Header property as a string.
    就是说get(url),其中url是你要得到的文件的url,inputfilemode属性如果是true,那么你得到的文件就在以body数行为文件名的文件里面,否则,得到的数据就在body属性里面。并且http协议的header信息再header属性里面。Declaration
    procedure Post(URL, PostData: string); virtual;Description
    The Post method posts the information specified by the PostData parameter to the document specified by the URL parameter.Parameters:
    The URL parameter specifies the document to post the data to.
    If the OutputFileMode property is TRUE, the PostData parameter specifies a file path and name that contains the data to be posted to the document specified by the URL parameter.
    If the OutputFileMode property is FALSE, the PostData parameter must contain the data that is to be posted to the document specified by the URL parameter.post(url,data)其中url是要接受你传递的信息的页面url,data参数是你要传递的数据。
    如果OutputFileMode属性是真,那么data指定一个本地的文件名称,否则data参数就是你要传递的数据。
    其实学学asp和html另外再看看http协议规范你就会很明白了。