Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make Lua cURL v3 initiate a GET query #119

Closed
4mig4 opened this issue Feb 7, 2018 · 2 comments
Closed

Can't make Lua cURL v3 initiate a GET query #119

4mig4 opened this issue Feb 7, 2018 · 2 comments
Labels

Comments

@4mig4
Copy link

4mig4 commented Feb 7, 2018

I can't make Lua cURL v3 initiate a GET query using the following code:

  local c = curl.easy{                          
         url = su,
         httpget = true,
         [curl.OPT_USERPWD] = l..":"..p,
         httpheader = { "Content-Type: application/x-www-form-urlencoded"; };
         postfields = 'params={ "token": "'..st..'" }';
     } 

or

  local c = curl.easy{                          
         url = su,
         [curl.OPT_HTTPGET] = true,
         [curl.OPT_USERPWD] = l..":"..p,
         httpheader = { "Content-Type: application/x-www-form-urlencoded"; };
         postfields = 'params={ "token": "'..st..'" }';
     } 

POST works fine though.

@moteus
Copy link
Member

moteus commented Feb 7, 2018

If I remember correctly you should set custom method as GET.
Do not remember how parameter calls

@4mig4
Copy link
Author

4mig4 commented Feb 8, 2018

Yes OPT_CUSTOMREQUEST made it work

You can close this issue.

@moteus moteus added the question label Feb 8, 2018
@moteus moteus closed this as completed Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants