开发者

http status from gsoap header

开发者 https://www.devze.com 2023-01-08 08:14 出处:网络
does anybody knows how to retrieve the http status in gSoap? I have \"HTTP/1.1 202 ACCEPTED开发者_开发知识库...\" and I want to print the 202 somehow.Your question is vague, so I am going to assume a

does anybody knows how to retrieve the http status in gSoap?

I have "HTTP/1.1 202 ACCEPTED开发者_开发知识库..." and I want to print the 202 somehow.


Your question is vague, so I am going to assume a literal interpretation and that you are really asking a C question... You say you have "HTTP/1.1 202 ACCEPTED...", and that you want to print the 202 somehow. Here is how you would do that in C:

  char buf[]={"HTTP/1.1 202 ACCEPTED..."}; //create a buffer here
  char *buff; //use your own buffer with the strtok function

  buff = strtok(buf, " "); //will contain "HTTP/1.1"
  buff = strtok(NULL, " ");//will contain "202"
  printf(buff)
  getchar();

If this is not what you wanted, please be more specific in your question.

Regards, Ryyker


After the web service invocation completes you will receive an error code of 202. It's that simple. All HTTP codes except 200/400/500 are passed down to the caller "as-is", so you can catch these. Just check if the value of soap->error == 202.

0

精彩评论

暂无评论...
验证码 换一张
取 消