# Libcurl and Stripe

**URL:** <https://clarionhub.com/t/libcurl-and-stripe/2444>\
**Category:** questions\
**Tags:** api, libcurl\
**Created:** [February 21, 2019, 9:30am UTC](https://clarionhub.com/t/libcurl-and-stripe/2444 "2019-02-21T09:30:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel1](https://clarionhub.com/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@Daniel1](https://clarionhub.com/u/Daniel1)\
**Post date:** [February 21, 2019, 9:30am UTC](https://clarionhub.com/t/libcurl-and-stripe/2444/1 "2019-02-21T09:30:55Z")

</div>

Hello  
I also asked Mike Duglas for help but maybe someone here know the answer.  
I'm using Stripe API and second call looks like this:

```auto
curl https://api.stripe.com/v1/charges \
  -u sk_test_xqpWDTDwbnbfbVYVVpet70mp: \
  -d amount=999 \
  -d currency=usd \
  -d description="Example charge" \
  -d source=tok_visa

```

I meant to use something like this:

loc:link = [https://api.stripe.com/v1/charges](https://api.stripe.com/v1/charges)

loc:postParams = 'amount=999&currency=usd&description="Example charge"&source=tok\_visa'

res = curl.SendRequestStr(loc:link, loc:PostParams, respBuffer)

but I don't know how to use first parameter:

-u sk\_test\_xqpWDTDwbnbfbVYVVpet70mp:

Thank you

---

<div class="post-metadata">

**Author:** ![brahn](https://clarionhub.com/user_avatar/clarionhub.com/brahn/32/756_2.png) [@brahn](https://clarionhub.com/u/brahn)\
**Post date:** [February 21, 2019, 10:10am UTC](https://clarionhub.com/t/libcurl-and-stripe/2444/2 "2019-02-21T10:10:47Z")

</div>

I highly recommend prototyping in something like [Postman](https://www.getpostman.com) and then, once you figure out the correct incantations, you will have a huge headstart on implementing it. Postman even generates code for you, libcurl being one of the target languages.

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [February 21, 2019, 10:18am UTC](https://clarionhub.com/t/libcurl-and-stripe/2444/3 "2019-02-21T10:18:05Z")

</div>

-u switch means user:pwd pair, so you should call

> curl.SetUserPwd(‘sk\_test\_xqpWDTDwbnbfbVYVVpet70mp’, ‘’)

in this case.

---

<div class="post-metadata">

**Author:** ![Daniel1](https://clarionhub.com/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@Daniel1](https://clarionhub.com/u/Daniel1)\
**Post date:** [February 21, 2019, 11:32am UTC](https://clarionhub.com/t/libcurl-and-stripe/2444/4 "2019-02-21T11:32:53Z")

</div>

> [@Mike\_Duglas](#):
>
> curl.SetUserPwd(‘sk\_test\_xqpWDTDwbnbfbVYVVpet70mp’, ‘’)

Ok, thank you so much, I will do that.

---

<div class="post-metadata">

**Author:** ![Mike\_Duglas](https://clarionhub.com/user_avatar/clarionhub.com/mike_duglas/32/1061_2.png) [@Mike\_Duglas](https://clarionhub.com/u/Mike_Duglas)\
**Post date:** [February 21, 2019, 1:02pm UTC](https://clarionhub.com/t/libcurl-and-stripe/2444/5 "2019-02-21T13:02:15Z")

</div>

> [@Libcurl faq (https://github.com/mikeduglas/libcurl)](https://clarionhub.com/t/libcurl-faq-https-github-com-mikeduglas-libcurl/1965/2):
>
> Another example: curl -u jsmith:jsmith -X POST -F “environment=TEM” -F “filename=Test” -F “multipartFile=@mmabc.manifest” ‘[https://server.com/api/manifests](https://server.com/api/manifests)’ -u jsmith:jsmith defines login and password and translated to curl.SetUserPwd(‘jsmith’, ‘jsmith’). -F “environment=TEM” sends the data as a [multipart formpost](https://ec.haxx.se/http-multipart.html): curl.FormAdd(‘environment’, ‘TEM’). -F “multipartFile=@mmabc.manifest” sends a file: curl.FormAddFile(‘multipartFile’, ‘mmabc.manifest’). For formpost, call curl.FormPost() met…
