Sending a file to server with httprequest

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Posts: 51
Joined: Wed Mar 18, 2015 5:52 am

Sending a file to server with httprequest

Post by loulou2522 »

How can I send an xml file generated on the client to the server? When I use httprequest, I get an error message

Code: Select all

Procedure HttpGetEvent1(Success, Result$, UserData)
  If Success
    debug result$
    Debug "Successful connection for PDF file calculation".
  Else
    debug result$
    Debug "Error: No Connection" + "Line 3995
  EndIf
 
  
EndProcedure
NewMap Headers$()
  Headers$("Access-Control-Allow-Origin") = "*"
  Headers$("HeaderContentType") = "application/xml"
   Headers$("Accept") = "application/xml"
  


  Global url.s="https://xxxx/xx.xml"
HTTPRequest(#PB_HTTP_Post,url,"",@HttpGetEvent1(),0,Headers$())
Thanks
plouf
Posts: 194
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: Sending a file to server with httprequest

Post by plouf »

your script and target server should be in the same xxxx.xx domain
for test in house, you can use CORS plugin in your broweser, but thats only for test ...

discussions
viewtopic.php?f=6&t=2041&p=7715&hilit=cors
viewtopic.php?f=6&t=2186&p=8235#p8235
Christos
Post Reply