Jump to content

Recommended Posts

Posted

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?

Posted

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

Posted

@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!

Posted
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! 🍻

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...