WHM Posted April 27, 2022 Posted April 27, 2022 Good day all, I'm trying to write a program that does a API call to send geojson data from CAD to the webserver. I've already built a lisp to geojson parser, but doing a HTTP PUT request is a bit beyond me. Has anyone built something similar? Quote
WHM Posted April 28, 2022 Author Posted April 28, 2022 I came up with something very similar, but couldn't get it to work. I think it might be because I'm not sending a header through. With this I get a response from the server, but the data is not getting accepted. In the thread you sent me I see they build a header. Let me test and see if I can get it to work! (defun _upload (data / xml) (setq server "https://www.1map.co.za/api/v1/spatial/geometry/4175?token=" xml (vlax-create-object "WinHTTP.WinHTTPRequest.5.1")) (vlax-invoke-method xml 'open "POST" server :vlax-false) (vlax-invoke-method xml 'send data) (print (vlax-get-property xml 'responsetext)) (if xml (vlax-release-object xml)) ) Thanks @ronjonp Quote
WHM Posted April 28, 2022 Author Posted April 28, 2022 @ronjonp Thank you very much! I don't know how I missed that thread, but that gave me the missing link, all it needed was a header! Quote
ronjonp Posted April 28, 2022 Posted April 28, 2022 9 hours ago, WHM said: @ronjonp Thank you very much! I don't know how I missed that thread, but that gave me the missing link, all it needed was a header! Glad to help! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.