The following code sends the GET request. It's making me crazy. At the moment I'm not sure anyone has used F # to send an HTTP post. Has anyone seen the document about this? Works fine for me (for example Result: Maybe you are using it in any other way? Post DocRou (URL: String) (Data: String): String = Data: Byte [] = SystemText. Encoding. ASCII Gatebyte (Data); Request = webrile Request (url) request Method & lt; - "Post" request. Content type & lt; - "Application / X-www-Form-URLXD" request. Contact lamen & lt; - (int64) data ' Long use wstream = Write.GetRequestStream () wstream.write (data ', 0, (data'.Length)) wstream.Flush () wstream.Close (* Use the author = New StreamWriter (wstream) author. (Data ') Writer. Flush () Writer. Close () *) Respond = Request. Use GarethSpons () Reader = New Streammorder (Reaction GateresonsStream ()) Outlook = Reader Read android () reader Close () response Close () request .bort () output
posttestserver.com Actually exists):
printfn "response:% A" (Postcrack "http://posttestserver.com/post.php" "Hello = Data") console.readline () | & Gt;
Feedback: "Successfully left 1 post variable. The post was 0 characters long."
Comments
Post a Comment