Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 1 Jahr
Letzter Beitrag:
vor 1 Jahr
Beteiligte Autoren:
Jim Carson, Jose Antonio Garrido, Fabrice Harari, Paulo Oliveira

cURL and WD21

Startbeitrag von Jim Carson am 26.10.2016 13:12

Has anyone used cURL with Windev to process HTTPrequest's. If so, any hints?

Antworten:

Hi Jim

why would we do that? Why not use the native httprequest/httpgetresult/httpform functions?

Best regards

von Fabrice Harari - am 26.10.2016 13:52
I have tried these. The problem is the header that is sent (I think). I can't figure out how to see all of the HTTPrequest details. (Header, Body) The header that is sent is the issue. When I try to get info on the request, I get the error "An element of 'httpRequest' type cannot be converted to the 'ANSI string' type.". From within the ide can I preview the data that is being sent.

EDIT: I am getting a 403 Forbidden error when I submit the request via HTTPsend.

von Jim Carson - am 26.10.2016 14:28
did you use one httpRequest/httpResponse variables and HTTPSend function?

what is in the Content,Header and Method properties?

http://doc.windev.com/en-US/?1000021158
http://doc.windev.com/en-US/?1000021165
http://doc.windev.com/en-US/?1000021183

von Paulo Oliveira - am 26.10.2016 17:05
Quote
Jim Carson
I can't figure out how to see all of the HTTPrequest details


Hi,
You can use a too likel wireshark, as Fabrice said in another post. It's free and easy to use.

Another way to monitor is to create a socket within windev with SocketCreate() and then send the httprequest to yourself
You can trace the content received by using trace()

So this request (from windev online help):

cMyRequest is httpRequest
cMyRequest..URL = "127.0.0.1:5010" //5010 is the port is the port I chosed in SocketCreate()
cMyResponse is httpResponse = HTTPSend(cMyRequest)


Shows this trace window:

GET / HTTP/1.1User-Agent: PC SOFT FrameworkHost: 127.0.0.1:5010Accept: */*


This is the code used to create the socket:

SocketCreate("Consommation",5010,"127.0.0.1")
SocketChangeTransmissionMode("Consommation",SocketNoEndTag)



Apart from monitoring what is being send you will need to test what changes are needed stop the error response.
For that you can use Telnet command, that comes in window (But from windows7 and later you will have to activate it via control panel / add remove programs).

It's very simple to use:
Telnet 127.0.0.1 5010
or
Telnet www.google.com 80

And then write (even if you can see what you are writing) for example:
GET
and press enter, and you will get the full response of the http server

Instead of a simple GET put the full http request.

Regards,
José Antonio.

von Jose Antonio Garrido - am 26.10.2016 22:13
Thank you. Very helpful.

von Jim Carson - am 28.10.2016 16:06
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.