Question
· Nov 9, 2016

access php

Hi,

How to post and get data using php. I'm using a php external url. In the body in parsing the request as xml and when i execute this using fiddler it response the result as xml but when i consume it in classmethod it fails. I don't have a wsdl file how can i work it out? My class method is
Example: :http://xyz.com/req/data.php

ClassMethod postData(Object As %VarString) As %VarString
{
  s server="http://xyz.com" 
  s path="/req/data.php"
  s data=$zcvt(Object,"O","URL")
  s http=##class(%Net.HttpRequest).%New()
  s http.Server=server
  s http.Port=80
  s http.ContentType="text/plain"  
  d http.InsertFormData("Request",Object)
  d http.Post(path)
  d $SYSTEM.OBJ.Dump(http.HttpResponse)
  s resp=http.HttpResponse.Data
  s response=resp.Read()
  QUIT response
}
Discussion (2)0
Log in or sign up to continue