0

Is it possible to make Http Patch request using only vanilla JavaScript?

I've only done it using 3rd party packages, frameworks before...

I'm building an email using C# .NET

The emailer parses html code as the email content and it renders the string as html code.

I would like to include a button that performs "PATCH" request and processes the response content.

Is it possible doing that with only Vanilla JavaScript?

Thanks

Thomas
  • 11,958
  • 1
  • 14
  • 23
Evan Park
  • 528
  • 1
  • 6
  • 20
  • 1
    Yes it is. Where did you get stuck? Could you share your attempts? – Thomas Aug 09 '17 at 00:54
  • @Thomas I haven't tried writing code yet. Is there an example I can base my work on? I've been googling with "Vanilla Javascript Http Request", "Pure Javascript Http Request" and others that are eimilar, but wasn't able to find good example :(... – Evan Park Aug 09 '17 at 00:56
  • google "xmlhttprequest open patch" – Jorg Aug 09 '17 at 00:57
  • @user2662520 Your question is really very vague. What would be a good example? All you've told us about your problem is that you want to send an AJAX request with the PATCH request method. So every basic example on sending an AJAX request should explain that. And I'm confident that you can change a `"POST"` into a `"PATCH"`. To get a better answer you have to explain a bit more on what you've actually tried and where you got stuck. How the request and data has to be formatted for the backend, ... all that jazz. – Thomas Aug 09 '17 at 01:03
  • "Is it possible doing that with only Vanilla JavaScript?" Stop and think for a moment. There isn't a single JS library which adds new functionality to the language. They just make tasks easier to perform. If it isn't possible in native JS, it isn't possible in a library. – ProgrammingLlama Aug 09 '17 at 01:14
  • Possible duplicate of [Can you make a HTTP PATCH request from Javascript?](https://stackoverflow.com/questions/7502278/can-you-make-a-http-patch-request-from-javascript) <-- Note that this would have been the second item in the "Questions that may already have your answer" at the time you created your question. – ProgrammingLlama Aug 09 '17 at 01:15

0 Answers0