2 Replies Latest reply on Jan 31, 2015 4:18 PM by pjreagan

    Insert from URL Http status code



      Insert from URL Http status code


      Hi everyone,

      I'm trying to get the http status code after using the 'Insert from URL' script step.
      Is there any way to achieve this?

      This is required since this determines wether the request was correct or not.

      Thanks for reading!

      Best regards,

        • 1. Re: Insert from URL Http status code

          As far as I know there is no way to pull info from the HTTP headers directly by using the Insert From URL script step.

          If I was going to do something like that I would create a custom PHP page that would use cURL to send a request to the intended destination. cURL can tell you what the response code is, I believe there is even an option to follow 301 redirects. You could even use the Filemaker PHP API to write the status code to a record in the database.

          Or you could use a webviewer and have the webviewer load javascript to make an ajax call to final URL. Ajax's xmlhttpresponse will give you the http response code back

          • 2. Re: Insert from URL Http status code

            Can you use a plugin?  The free BaseElements plugin will (apparently) do the cURL work for you.  First use a set field to Get the URL. Then use another set field step to get the code.  The example below sets fields in a "Pages" table.  (There's also a plugin function that gets the headers.)