-
Notifications
You must be signed in to change notification settings - Fork 1
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
restclient post json #11
base: master
Are you sure you want to change the base?
Conversation
@@ -12,7 +12,7 @@ namespace :eventually_tracker do | |||
api_key = Base64.encode64 EventuallyTracker.config.api_key | |||
api_secret = Base64.encode64 EventuallyTracker.config.api_secret | |||
logger.debug "Publish event: #{event} to #{uri.to_s}." | |||
RestClient.post uri.to_s, event: event, content_type: :json, accept: :json, api_key: api_key, api_secret: api_secret | |||
RestClient.post uri.to_s, {event: event, api_key: api_key, api_secret: api_secret}.to_json, content_type: "application/json", accept: :json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L'api_key et api_secret vont se retrouver dans le body et non dans le header comme ça. Je suis d'accord de faire {event: event}.to_json mais je vois pas pourquoi il faut mettre l'api key et secret en json aussi...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bien vu je corrige ca de suite
attend que je je regarde si ca fonctionne toujour bien en prenant en compte ton commentaire. |
okay, j'attends le feedback |
un mois plus tard, je redecouvre le post-it qui me dis de te dire que c'est bon ;) |
a wrong content type was send. now it's realy json