West Wind Internet and Client Tools
wwHttp GET and POST methods
Gravatar is a globally recognized avatar based on your email address. wwHttp GET and POST methods
  Boris Henkin
  All
  May 12, 2022 @ 10:14am

I am trying to use wwHttp for REST API services. I don't see GET and POST methods which are utilized in all the examples including code snippets in these forums. I see Httpget and Send methods - but since GET and POST are everywhere - I am wondering maybe I am missing something. Thanx

Gravatar is a globally recognized avatar based on your email address. re: wwHttp GET and POST methods
  Rick Strahl
  Boris Henkin
  May 12, 2022 @ 12:13pm

It's in newer versions of the client tools - v7 onwards I think is when these got added. The new methods are just proxy wrappers around HttpGet().

You can use HttpGet() with older versions - it's just a little more verbose as you have to explicit AddPostKey() set the content type etc.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwHttp GET and POST methods
  Boris Henkin
  Rick Strahl
  May 12, 2022 @ 12:23pm

Thank you, Rick! Now it makes sense, so I use AddPostKey() and then should use Send?

Gravatar is a globally recognized avatar based on your email address. re: wwHttp GET and POST methods
  Rick Strahl
  Boris Henkin
  May 12, 2022 @ 01:55pm

There's no Send() in old versions. HttpGet() is the underlying method that does the work.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwHttp GET and POST methods
  Boris Henkin
  Rick Strahl
  May 12, 2022 @ 02:06pm

I am sorry, I meant implementing http post. I am doing a set of AddPostKey and then what to POST to the server?

Gravatar is a globally recognized avatar based on your email address. re: wwHttp GET and POST methods
  Rick Strahl
  Boris Henkin
  May 12, 2022 @ 02:27pm

It doesn't matter. .HttpGet() is the low level method that does everything. .Send() was added recently for clarity as the low level method. Even for POST (or any other verb) you need to use .HttpGet().

Or maybe it's time to update to a more recent version of the Client Tools 😃 There are lots of improvements especially for calling REST services and JSON parsing support.

+++ Rick ---

© 1996-2024