PostMethod

Status
Nicht offen für weitere Antworten.
I

Imogen

Gast
Hallo

Ich greife über die apache libs (commons-httpclient-3.0.1.jar/commons-codec-1.3.jar) auf eine php Seite zu.
Hier der Code:

HttpClient client = new HttpClient();
// build post request
PostMethod post = new PostMethod(https://authentication.x.org/x.php);
NameValuePair[] postMsg = new NameValuePair[] {
new NameValuePair(PARAM_APP_METHOD, appMethod),
new NameValuePair(PARAM_APP_CODE, plainAuthCode),
new NameValuePair(PARAM_APP_VERSION, this.version),
new NameValuePair(PARAM_MACHINE_CODE, this.machineid),
new NameValuePair(PARAM_APP_ID, Activation.APPID)
};
post.setRequestBody(postMsg);

Das Funktioniert alles gut, jetzt möchte ich noch 3 Params mitgeben (username, passwort und server). Weiss jemand wie ich die 3 Params jetzt noch mitgeben kann?

Danke
Imogen[/code]
 
N

Nerdi

Gast
Kein Grund gleich beleidigend zu werden... :noe:

Ich bin da auch nicht sattelfest. Hast dus es schon so probiert?

Code:
HttpClient client = new HttpClient(); 
// build post request 
PostMethod post = new PostMethod([url]https://authentication.x.org/x.php[/url]); 
NameValuePair[] postMsg = new NameValuePair[] { 
new NameValuePair(PARAM_APP_METHOD, appMethod), 
new NameValuePair(PARAM_APP_CODE, plainAuthCode), 
new NameValuePair(PARAM_APP_VERSION, this.version), 
new NameValuePair(PARAM_MACHINE_CODE, this.machineid), 
new NameValuePair(PARAM_APP_ID, Activation.APPID) 
new NameValuePair(PARAM_USERNAME, username), 
new NameValuePair(PARAM_PASSWORD, password), 
new NameValuePair(PARAM_SERVER, server) 
}; 
post.setRequestBody(postMsg);

Nerdi
 
G

Guest

Gast
SlaterB hat gesagt.:
schon mal die Idee vom Intellekt eines Schulkindes gehabt?:
abgucken, Tutorials und Beispiele lesen?
view=markup

ich bin nie beleidigend, nur deutlich

Deutlich wär: Es gibt Tutorials und Beispiele wo das drin steht.

Deine Anekdote hört sich mehr danach an als ob du etwas anderes kompensieren musst. Aus welchem Grund "beantwortest" du hier Fragen? Um zu helfen oder um dich selbst zu profilieren? :roll:
 
Status
Nicht offen für weitere Antworten.

Neue Themen


Oben