# Libcurl faq (https://github.com/mikeduglas/libcurl)

**URL:** <https://clarionhub.com/t/libcurl-faq-https-github-com-mikeduglas-libcurl/1965>\
**Category:** faq\
**Tags:** libcurl\
**Created:** [July 3, 2018, 5:20pm UTC](https://clarionhub.com/t/libcurl-faq-https-github-com-mikeduglas-libcurl/1965 "2018-07-03T17:20:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 4, 2018, 6:15pm UTC](https://clarionhub.com/t/libcurl-faq-https-github-com-mikeduglas-libcurl/1965/2 "2018-07-04T18:15:46Z")

</div>

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() method instead of curl.SendRequest():**

```
  curl.Init()

  !-- add form fields
  cfres = curl.FormAdd('environment', 'TEM')
  cfres = curl.FormAdd('filename', 'Test')
  !-- add file
  cfres = curl.FormAddFile('multipartFile', 'mmabc.manifest')

  curl.SetUserPwd('jsmith', 'jsmith')

  respfile = 'FormPost_response.txt'
  res = curl.FormPost('https://server.com/api/manifests', respfile)

```

---

_[View the full topic](https://clarionhub.com/t/libcurl-faq-https-github-com-mikeduglas-libcurl/1965)._
