I needed to figure out what method and headers Insert from URL sent when making requests.  Insert from URL supports a number of different protocols, now.  The two that I was interested in were “http” and “httppost”.  Here is what I found.

Why?

I am interested in connecting FileMaker to various web APIS and I was curious to see how far I could get without a plugin. Many web APIs use POST, as that it the default way to send data to a server. Now that FileMaker supports POST, things are a bit more interesting.

RequestBin

I used RequestBin to investigate what was actually sent from Insert From URL.  RequestBin gives you an endpoint to send your request to and then just prints out what it receives.  You can check it out here.  http://requestb.in

When is a “post” not a “post”?

It turns out then you use the POST form of the URL, “httppost://…”, Insert From URL doesn’t actually do a POST unless you give the url something to POST.  It just does a GET.  I suppose this is OK, since POST almost always requires that you post something to the server. But it did catch me by surprise

http

When you use “http://requestb.in/<yourrequestbin>?firstName=todd” as the url in an Insert From URL this is what actually gets sent. Method:

GET

Headers

Connection: close X-Request-Id: 5c88d3d6-079d-4abe-b012-fd7406216335 User-Agent: FileMaker/13.0 Host: requestb.in Accept-Encoding: deflate, gzip Accept: */*

Form/Post Parameters

none

QueryString

firstName: todd

httppost

When you use “httppost://requestb.in/<yourrequestbin>?firstName=todd” as the url in an Insert From URL this is what actually gets sent. Method

POST

Headers

Content-Length: 14 Host: requestb.in User-Agent: FileMaker/13.0 Content-Type: application/x-www-form-urlencoded X-Request-Id: a30f1e64-ae37-4ada-a093-24f3270707ab Accept-Encoding: deflate, gzip Connection: close Accept: */*

Form/Post Parameters

firstName:todd

Raw Body

firstName=todd

Thats it ! 🙂