Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Eli

    (@scheeeli)

    If you can pass them as _GET parameters in the QUERY_STRING that would be the easiest way. If not then what kind of login is it.

    Thread Starter cowlicker12

    (@cowlicker12)

    I’m new to WordPress and cURL. Could you give an example of what you mean by sending them as _GET parameters in the QUERY_STRING?

    Thread Starter cowlicker12

    (@cowlicker12)

    Oh, wait I should mention that I actually need to send a token of the form “blank:blank”

    Plugin Author Eli

    (@scheeeli)

    cURL is incredibly useful and powerful for many methods of retrieving remote content from another site. However, if you are trying to do anything more that simply fetching an unsecured HTML page from a publicly accessible website then it can get very tricky very fast.

    When connecting to a password protected page you need to understand what kind of authentication is being use to know how to configure cURL, and you may not be able to use a shortcode to do it without modifying the code.

    Thread Starter cowlicker12

    (@cowlicker12)

    I know that the cURL request below works because I tested it on a terminal. Now I want to use your shortcode plugin to make the exact same request. All I know is that the endpoint needs an API token (which the client gave me and is labeled “blank1: blank2” below). How would you put this request into your shortcode’s syntax?

    curl -XGET -H "blank1: blank2" -H "Content-Type: application/json" "https://website.net/employeestatus?key=Adam.Smith|Adam%20Smith"

    I’ve tried the 2 methods below, but they both return a not-authorized error.

    1. [remote_content url="https://website.net/employeestatus?key=Adam.Smith|Adam%20Smith" method="GET" header="blank1: blank2" header="Content-Type: application/json"]

    2. [remote_content url="https://website.net/employeestatus?key=Adam.Smith|Adam%20Smith" method="GET" header="blank1: blank2" header="Content-Type: application/json" userpwd="blank1: blank2"]

    • This reply was modified 6 years, 10 months ago by cowlicker12.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Sending username and password as parameters’ is closed to new replies.