Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Module
Thu, Apr 23 2020 5:13 PMPermanent Link

KimHJ

Comca Systems, Inc

I have a company that is sending me json files and I have to give them my URL to my web service.

Right now I send json to my webservice from my windows program using this URL.

https://mydomain.com:8100/modules/mymodule?password=xxxxx&user=xxxxx

The company want me to enter the username and password in there form and then they will add it to the header.

I was told that they strip the URL

I tried to do both with the above url and this url entering the password and user in their form for them to add it to the header.
https://mydomain.com:8100/modules/mymodule

But password and username show blank in both cases.

I tried to enter it like this in their form X-EWBUser:xxxxx and X-EWBPassword:xxxxx

No luck.

Here is how I try to retrieve the Username and password:
Request.RequestUser
Request.RequestPassword

Thanks for any help.
Kim
Thu, Apr 23 2020 5:33 PMPermanent Link

Walter Matte

Tactical Business Corporation


Look at property:  RequestParams

   Request.RequestParams

Walter
Thu, Apr 23 2020 5:33 PMPermanent Link

KimHJ

Comca Systems, Inc

I just received a email how they send it:

POST https://your-serverAccept-Encoding: gzipAuthorization: Basic aHVudGVyMTIzOmNvcnJlY3QtaG9yc2UtYmF0dGVyeS1zdGFwbGU=Content-Type: application/json; charset=utf-8User-Agent: bandwidth-apiContent-Length: 385Connection: keep-alive[    {        "time": "2020-04-23T20:13:30.932Z",        "type": "message-received",        "to": "+19104271751",        "description": "Incoming message received",        "message": {            "id": "5002c6c3-dfa6-456e-81de-0672833fd8e4",            "owner": "+19104271751",            "applicationId": "82e028a4-a852-4c65-98fc-80d18216e527",            "time": "2020-04-23T20:13:29.789Z",            "segmentCount": 1,            "direction": "in",            "to": [                "+19104271751"            ],            "from": "+19104271752",            "text": "asdf"        }    }]

Where the string aHVudGVyMTIzOmNvcnJlY3QtaG9yc2UtYmF0dGVyeS1zdGFwbGU once Base64 Decoded is: hunter123:correct-horse-battery-staple

How would I read this from the Request in me module?

Kim
Thu, Apr 23 2020 5:36 PMPermanent Link

Walter Matte

Tactical Business Corporation

KimHJ wrote:

I just received a email how they send it:

POST https://your-serverAccept-Encoding: gzipAuthorization: Basic aHVudGVyMTIzOmNvcnJlY3QtaG9yc2UtYmF0dGVyeS1zdGFwbGU=Content-Type: application/json; charset=utf-8User-Agent: bandwidth-apiContent-Length: 385Connection: keep-alive[    {        "time": "2020-04-23T20:13:30.932Z",        "type": "message-received",        "to": "+19104271751",        "description": "Incoming message received",        "message": {            "id": "5002c6c3-dfa6-456e-81de-0672833fd8e4",            "owner": "+19104271751",            "applicationId": "82e028a4-a852-4c65-98fc-80d18216e527",            "time": "2020-04-23T20:13:29.789Z",            "segmentCount": 1,            "direction": "in",            "to": [                "+19104271751"            ],            "from": "+19104271752",            "text": "asdf"        }    }]

Where the string aHVudGVyMTIzOmNvcnJlY3QtaG9yc2UtYmF0dGVyeS1zdGFwbGU once Base64 Decoded is: hunter123:correct-horse-battery-staple

How would I read this from the Request in me module?

Kim
Thu, Apr 23 2020 5:37 PMPermanent Link

Walter Matte

Tactical Business Corporation


Look at Request.RequestContent

Walter
Thu, Apr 23 2020 5:47 PMPermanent Link

KimHJ

Comca Systems, Inc

Walter Matte wrote:

>>Look at Request.RequestContent<<

Walter

I did the following and all I get is the json part.

TempContent:=TStringList.Create;
TempContent.Text:=UTF8ToWideString(Request.RequestContent);

Kim
Thu, Apr 23 2020 7:36 PMPermanent Link

KimHJ

Comca Systems, Inc

I'm still trying, but I don't get any results.

Here is my latest, what is it I'm doing wrong?

This is blank:
MyPassword: String;
MyPassword := Request.RequestHeaders.Values['Authorization'];

I tried this to see the value pairs, nothing.
for I :=0 to Request.RequestContentParams.Count -1 do
    MyPassword := MyPassword + ' , ' + Request.RequestContentParams.Strings[i];

Kim
Fri, Apr 24 2020 3:45 AMPermanent Link

Matthew Jones

Walter Matte wrote:

> Look at Request.RequestContent

This will be in the request headers somewhere. If you have access to the headers, you are sorted. If not, Tim will have to add access.

--

Matthew Jones
Image