Jump to content

Alternative to "--include" For Response Headers?


This topic is 2457 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm trying to get a token from an authorization server using cURL in Insert From URL. When I make the following request in Terminal

curl -i -X POST -d 'username=myaccountname&password=mypassword' https://authserver.com/login

I get the token back in the response header.

Since FileMaker doesn't support the --include (-i) option I haven't been able to figure out how to get the response header with the token.  Anyone have any ideas on how to accomplish this?

Thanks in advance!

-Kent

UPDATE:

Okay, I figured out I can get a response header by using the option --dump-header and setting it to a variable. The only problem now is that the token comes from a redirect location and I'm only getting the response header from the original URL. I'll keep working on it but I'll be happy to get whatever advice anyone can offer in the meantime. 

Edited by Kent Searight
Link to comment
Share on other sites

Never mind. I got it to work with the following cURL options.

-L -d 'username=myaccountname&password=mypassword' --cookie-jar $cookies

I'm curious though if anyone knows why FMI chose not to support the --include option. 

Edited by Kent Searight
Link to comment
Share on other sites

  • 2 weeks later...
7 hours ago, Wang said:

How did you get response header with dump-header?

Turned out I didn't need the headers. The result of --cookie-jar was all I needed. But if I'd wanted the headers too all I'd need to do is follow that option with a variable and it would write to that. Example: --dump-header $myVariable. 

Link to comment
Share on other sites

This topic is 2457 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.