Creating a new method (aka, function) in a SparkJava micro-service

Thanks for your reply.

Not sure what was going on with the video as it was just a link to a DB file. Others seemed to have the same problem, but it sounds like it cleared up.

Thanks Steve! :slight_smile:

1 Like

It still takes about 1-2 mins for the video to show for me. But I just downloaded it, so it's only an issue once for me.

That’s strange. It just starts for me right away. I was using Firefox not that it should make any difference.

Maybe some browsers download first, then play.

I think IE may do that.

Interesting.

On a mac:
Firefox - loads immediately. Plays immediately when I click play.
Safari - loads video play button immediately. Takes 5 secs or so when I click play to start ( see a spinning wheel in the play bar ).
Chrome - takes 1-2 mins to load a preview of the first "slide" of the video. Plays immediately when I click play.

3 Likes

Hi @anon45965781,
I'm just starting with micro-services and would like to see your videos.
I have set up SparkJava and Maven, modified a Hello World service and fetched the result in FileMaker.
Now I'm wondering how do I send a parameter or 2 to the service. I assume cURL options come into it.

1 Like

Awesome!

You can pass parameters using GET or POST (really with any HTTP verb since the semantics are up to you on the service side. However, GET and POST are most common).

With GET, you pass parameters right on the URL itself.

I created a video a while back showing how easy it is to get the data from a parameter passed to a GET method.

With POST, you read parameters from the Request body. You would use POST for more security and for larger POSTed values. I've posted entire books using FileMaker. (with POST, you use CURL options.)


With either method, you will often need to (especially for binary data or data with possibly problematic characters) use GetAsUrlEncoded() or even also Base64Encode() for transmission and then decode them in the service also.

Let me know how it goes!

Happy Coding!!! :slight_smile: