Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5968671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:07:23+00:00 2026-05-22T20:07:23+00:00

I have a couple of functions that perform HTTP POST/GET/HEAD requests. For the POST

  • 0

I have a couple of functions that perform HTTP POST/GET/HEAD requests.

For the POST request I use this:

http:request(post, {Url, [], ContentType, Body}, [], []).

While for the HEAD/GET I use:

http:request(Method, {Url, []}, [], [])

How can I write this two calls in a unique one? POST request has those two additional variables with respect to GET/HEAD request. I tried with empty lists but I got:

  ** exception error: no function clause matching

Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:07:23+00:00Added an answer on May 22, 2026 at 8:07 pm

    To use the call to httpc only once, you need to extract the Request tuple from the call because that’s what’s unique between the methods as you use them:

    post(URL, ContentType, Body) -> request(post, {URL, [], ContentType, Body}).
    get(URL)                     -> request(get,  {URL, []}).
    head(URL)                    -> request(head, {URL, []}).
    
    request(Method, Request) ->
        httpc:request(Method, Request, [], []).
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched and found a couple of solutions on this site, that didn't
I'll have couple of python functions I must interface with from the assembly code.
I have a couple old services that I want to completely uninstall. How can
I have a couple of triggers on a table that I want to keep
We have a scalar function that returns a DateTime. It performs a couple of
Recently there have been a couple questions regarding static type constraints and inline: Use
I have a couple of newbie Delphi Programming questions that I cannot seem to
Summary: I have a struct that is read/written to file. This struct changes frequently,
I have a couple of powershell command that are very simple. disable-mailbox dadelgad -confirm:$false
I have a couple of functions. Basically a menu where a user can choose

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.